summaryrefslogtreecommitdiffstats
path: root/tests/ui/derive-uninhabited-enum-38885.rs
blob: 0089453ef0f3991174aaf63b5be8246c5f8cb6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check-pass
// compile-flags: -Wunused

// ensure there are no special warnings about uninhabited types
// when deriving Debug on an empty enum

#[derive(Debug)]
enum Void {}

#[derive(Debug)]
enum Foo {
    Bar(u8),
    Void(Void), //~ WARN variant `Void` is never constructed
}

fn main() {
    let x = Foo::Bar(42);
    println!("{:?}", x);
}