]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-88730.rs
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / suggestions / issue-88730.rs
1 #![allow(unused, nonstandard_style)]
2 #![deny(bindings_with_variant_name)]
3
4 // If an enum has two different variants,
5 // then it cannot be matched upon in a function argument.
6 // It still gets a warning, but no suggestions.
7 enum Foo {
8     C,
9     D,
10 }
11
12 fn foo(C: Foo) {} //~ERROR
13
14 fn main() {
15     let C = Foo::D; //~ERROR
16 }