rust/src/test/ui/derive-uninhabited-enum-38885.rs

20 lines
367 B
Rust
Raw Normal View History

// build-pass (FIXME(62277): could be 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);
}