rust-clippy/tests/ui/crashes/ice-6254.rs
Matthias Krüger abd64d7c05 add a couple of ICE testcases
Fixes #6250
Fixes #6251
Fixes #6252
Fixes #6255
Fixes #6256
2020-10-28 23:35:11 +01:00

15 lines
460 B
Rust

// originally from ./src/test/ui/pattern/usefulness/consts-opaque.rs
// panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())',
// compiler/rustc_mir_build/src/thir/pattern/_match.rs:2030:5
#[derive(PartialEq)]
struct Foo(i32);
const FOO_REF_REF: &&Foo = &&Foo(42);
fn main() {
// This used to cause an ICE (https://github.com/rust-lang/rust/issues/78071)
match FOO_REF_REF {
FOO_REF_REF => {},
Foo(_) => {},
}
}