Closed
Description
enum Thing { This, That }
fn non_const() -> Thing {
Thing::This
}
pub const Q: i32 = match non_const() {
Thing::This => 1,
Thing::That => 0
};
error: internal compiler error: /checkout/src/librustc_mir/build/mod.rs:534: no terminator on block 10
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.24.0-nightly (0077d128d 2017-12-14) running on x86_64-unknown-linux-gnu
thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:448:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
This ICEs on nightly/beta, but produces a correct error on stable.
Originally reported on Reddit here.