diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/tests/ui/crashes/ice-6254.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6254.rs b/src/tools/clippy/tests/ui/crashes/ice-6254.rs new file mode 100644 index 000000000..a2a60a169 --- /dev/null +++ b/src/tools/clippy/tests/ui/crashes/ice-6254.rs @@ -0,0 +1,16 @@ +// 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 + +#[allow(clippy::derive_partial_eq_without_eq)] +#[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(_) => {}, + } +} |