-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Description
trait Foo {}
impl Foo for () {}
#[cfg(not(good))]
fn foo(x: bool) -> Box<Foo+'static> {
match x {
true => box() (),
false => box() ()
}
}
#[cfg(good)]
fn foo(x: bool) -> Box<Foo+'static> {
match x {
true => box() () as Box<Foo>,
false => box() () as Box<Foo>
}
}
fn main() {
foo(true);
foo(false);
}Compiling with --cfg good (i.e. explicit casts) runs 100% fine, compiling without it (i.e. implicit coercions) segfaults/crashes. This also runs fine on 0.12 on the playpen, and with if x { instead of match .
cc @nick29581 (maybe?)
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.