2023-01-05 02:45:44 -06:00
|
|
|
// originally from ./tests/ui/pattern/usefulness/consts-opaque.rs
|
2020-11-05 07:29:48 -06:00
|
|
|
// panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())',
|
|
|
|
// compiler/rustc_mir_build/src/thir/pattern/_match.rs:2030:5
|
|
|
|
|
2022-05-21 06:24:00 -05:00
|
|
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
2020-11-05 07:29:48 -06:00
|
|
|
#[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 => {},
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: to use a constant of type `Foo` in a pattern, `Foo` must be annotated
|
|
|
|
//~| NOTE: for more information, see issue #62411 <https://github.com/rust-lang/ru
|
2020-11-05 07:29:48 -06:00
|
|
|
Foo(_) => {},
|
|
|
|
}
|
|
|
|
}
|