mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
16 lines
284 B
Rust
16 lines
284 B
Rust
#![allow(unused, nonstandard_style)]
|
|
|
|
// If an enum has two different variants,
|
|
// then it cannot be matched upon in a function argument.
|
|
// It still gets an error, but no suggestions.
|
|
enum Foo {
|
|
C,
|
|
D,
|
|
}
|
|
|
|
fn foo(C: Foo) {} //~ERROR
|
|
|
|
fn main() {
|
|
let C = Foo::D; //~ERROR
|
|
}
|