diff options
Diffstat (limited to 'tests/ui/lint/dead-code/unused-variant.rs')
-rw-r--r-- | tests/ui/lint/dead-code/unused-variant.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/lint/dead-code/unused-variant.rs b/tests/ui/lint/dead-code/unused-variant.rs new file mode 100644 index 000000000..82108fa9c --- /dev/null +++ b/tests/ui/lint/dead-code/unused-variant.rs @@ -0,0 +1,12 @@ +#![deny(dead_code)] + +#[derive(Clone)] +enum Enum { + Variant1, //~ ERROR: variant `Variant1` is never constructed + Variant2, +} + +fn main() { + let e = Enum::Variant2; + e.clone(); +} |