Uh oh!
There was an error while loading. Please reload this page.
[MIR] Handle coercion casts properly when building the MIR - #33303
Conversation
Coercion casts (`expr as T` where the type of `expr` can be coerced to `T`) are essentially no-ops, as the actual work is done by a coercion. Previously a check for type equality was used to avoid emitting the redundant cast in the MIR, but this failed for coercion casts of function items that had lifetime parameters. The MIR trans code doesn't handle `FnPtr -> FnPtr` casts and produced an error. Also fixes a bug with type ascription expressions not having any adjustments applied. Fixesrust-lang#33295
rust-highfive
commented
May 1, 2016
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
arielb1
commented
May 1, 2016
@bors r+ |
bors
commented
May 1, 2016
📌 Commit 3906aef has been approved by |
bors
commented
May 1, 2016
[MIR] Handle coercion casts properly when building the MIR Coercion casts (`expr as T` where the type of `expr` can be coerced to `T`) are essentially no-ops, as the actual work is done by a coercion. Previously a check for type equality was used to avoid emitting the redundant cast in the MIR, but this failed for coercion casts of function items that had lifetime parameters. The MIR trans code doesn't handle `FnPtr -> FnPtr` casts and produced an error. Also fixes a bug with type ascription expressions not having any adjustments applied. Fixes#33295 /cc @eddyb
bors
commented
May 1, 2016
💔 Test failed - auto-mac-64-opt-rustbuild |
arielb1
commented
May 1, 2016
@alexcrichton @bors retry |
bors
commented
May 1, 2016
bors
commented
May 1, 2016
💔 Test failed - auto-win-msvc-32-opt |
arielb1
commented
May 1, 2016
What the **** - cc @nikomatsakis@michaelwoerister @bors retry |
bors
commented
May 1, 2016
bors
commented
May 1, 2016
💔 Test failed - auto-linux-64-opt-mir |
eddyb
commented
May 1, 2016
@bors retry |
bors
commented
May 1, 2016
bors
commented
May 1, 2016
💔 Test failed - auto-win-msvc-64-opt-mir |
alexcrichton
commented
May 1, 2016
@bors: retry On Sun, May 1, 2016 at 10:46 AM, bors notifications@github.com wrote:
|
alexcrichton
commented
May 1, 2016
Spurious because of #31657 |
bors
commented
May 2, 2016
[MIR] Handle coercion casts properly when building the MIR Coercion casts (`expr as T` where the type of `expr` can be coerced to `T`) are essentially no-ops, as the actual work is done by a coercion. Previously a check for type equality was used to avoid emitting the redundant cast in the MIR, but this failed for coercion casts of function items that had lifetime parameters. The MIR trans code doesn't handle `FnPtr -> FnPtr` casts and produced an error. Also fixes a bug with type ascription expressions not having any adjustments applied. Fixes#33295 /cc @eddyb
Coercion casts (
expr as Twhere the type ofexprcan be coerced toT) are essentially no-ops, as the actual work is done by a coercion.Previously a check for type equality was used to avoid emitting the
redundant cast in the MIR, but this failed for coercion casts of
function items that had lifetime parameters. The MIR trans code doesn't
handle
FnPtr -> FnPtrcasts and produced an error.Also fixes a bug with type ascription expressions not having any
adjustments applied.
Fixes#33295
/cc @eddyb