diff options
Diffstat (limited to 'tests/ui/lint/dead-code/unused-struct-variant.rs')
-rw-r--r-- | tests/ui/lint/dead-code/unused-struct-variant.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/lint/dead-code/unused-struct-variant.rs b/tests/ui/lint/dead-code/unused-struct-variant.rs new file mode 100644 index 000000000..a914e0c33 --- /dev/null +++ b/tests/ui/lint/dead-code/unused-struct-variant.rs @@ -0,0 +1,13 @@ +#![deny(unused)] + +struct F; +struct B; + +enum E { + Foo(F), + Bar(B), //~ ERROR variant `Bar` is never constructed +} + +fn main() { + let _ = E::Foo(F); +} |