rust/tests/ui/suggestions/issue-88730.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
322 B
Rust
Raw Normal View History

#![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
}