Closed
Description
The following code causes an ICE
fn main() {
let x = Some(Some(Some(1)));
match x {
Some::<Option<_>>(Some(Some(v))) => (),
_ => (),
}
}
Message:
error: internal compiler error: src/librustc/mir/tcx.rs:139: cannot downcast non-ADT type: `Ty { ty: _ }`
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:588:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error
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.33.0-nightly (c2d381d39 2019-01-10) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=1 -C llvm-args=--x86-asm-syntax=intel --crate-type rlib
Compiler returned: 101
This is marked as A-NLL because the bug is in MIR type check, even though it occurs with or without NLL.