-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: unsupported cast [MIR] #33295
Comments
More ICEy stuff: error: internal compiler error: src/librustc_trans/common.rs:1102: Encountered error `Unimplemented` selecting `Binder(<util::network::host::Host<service::SyncMessage> as util::IoHandler<util::NetworkIoMessage<Message>>>)` during trans coming from |
Minimal reproduction: pub struct Foo<'a> {
x: fn(&'a i32)
}
pub fn foo<'a>() -> Foo<'a> {
Foo {
x: the_fun as fn(&'a i32)
}
}
fn the_fun<'a>(_: &'a i32) { } It's the I'm pretty sure that |
@Aatch I added some code to not build noop casts, the lifetimes may be different here though? |
@eddyb possibly, doing |
@Aatch Problem is, you can't ignore lifetimes, what if this is a |
@petevine do you mind giving a backtrace for that second error and opening a new issue for it (since it's unrelated to the two in the main post). If you could reduce it to a smaller reproduction, that would be even better. |
There were no backtraces, unfortunately. Let's clarify one thing though - is turning |
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 rust-lang#33295
Actually MIR compilation has been bootstrappable for the compiler for a while now, so trying to use it for more complex codebases is really valuable, since it finds bugs like this. |
[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
@petevine The compiler doesn't generate a backtrace even if you set |
That was the case indeed. (both ended in a segfault) -original message- @petevine The compiler doesn't generate a backtrace even if you set You are receiving this because you were mentioned. |
@Aatch |
[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
Compiling the
hpack v0.2.0
crate withrustc 1.10.0-dev (8b1dcf40f 2016-04-29)
on ARM Linux:or
curl
:This was my first contact with mir and it wasn't peaceful :) Maybe I should have tried a
Hello Mir
, ermWorld
instead...The text was updated successfully, but these errors were encountered: