2021-09-27 19:16:04 -05:00
|
|
|
#![allow(unused, nonstandard_style)]
|
|
|
|
|
|
|
|
// If an enum has two different variants,
|
|
|
|
// then it cannot be matched upon in a function argument.
|
2022-11-08 09:24:06 -06:00
|
|
|
// It still gets an error, but no suggestions.
|
2021-09-27 19:16:04 -05:00
|
|
|
enum Foo {
|
|
|
|
C,
|
|
|
|
D,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo(C: Foo) {} //~ERROR
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let C = Foo::D; //~ERROR
|
|
|
|
}
|