2024-06-11 09:57:16 +00:00
|
|
|
//! This test used to ICE: rust-lang/rust#125914
|
|
|
|
|
//! Instead of actually analyzing the erroneous patterns,
|
|
|
|
|
//! we instead stop after typeck where errors are already
|
|
|
|
|
//! reported.
|
|
|
|
|
|
|
|
|
|
enum AstKind<'ast> {
|
|
|
|
|
//~^ ERROR: `'ast` is never used
|
|
|
|
|
ExprInt,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum Foo {
|
|
|
|
|
Bar(isize),
|
|
|
|
|
Baz,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum Other {
|
|
|
|
|
Other1(Foo),
|
|
|
|
|
Other2(AstKind), //~ ERROR: missing lifetime specifier
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
match Other::Other1(Foo::Baz) {
|
2025-06-03 10:03:42 +02:00
|
|
|
crate::Other::Other2(crate::Foo::Bar(..)) => {}
|
2024-06-11 09:57:16 +00:00
|
|
|
}
|
|
|
|
|
}
|