rust/src/test/ui/derive-uninhabited-enum-38885.rs
Val Markovic 2155adbc3a Moving more build-pass tests to check-pass
One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).

Helps with #62277
2020-04-23 20:21:38 -07:00

20 lines
330 B
Rust

// 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 never constructed
}
fn main() {
let x = Foo::Bar(42);
println!("{:?}", x);
}