mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
17 lines
322 B
Rust
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
|
|
}
|