rust/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs
2023-01-11 09:32:08 +00:00

13 lines
269 B
Rust

enum A {}
//~^ NOTE `A` defined here
//~| NOTE
fn f(a: &A) {
match a {}
//~^ ERROR non-exhaustive patterns: type `&A` is non-empty
//~| NOTE the matched value is of type `&A`
//~| NOTE references are always considered inhabited
}
fn main() {}