rust/tests/ui/suggestions/issue-88730.rs
2023-01-11 09:32:08 +00:00

17 lines
322 B
Rust

#![allow(unused, nonstandard_style)]
#![deny(bindings_with_variant_name)]
// If an enum has two different variants,
// then it cannot be matched upon in a function argument.
// It still gets a warning, but no suggestions.
enum Foo {
C,
D,
}
fn foo(C: Foo) {} //~ERROR
fn main() {
let C = Foo::D; //~ERROR
}