mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
19 lines
370 B
Rust
19 lines
370 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(#[allow(dead_code)] u8),
|
|
Void(Void), //~ WARN variant `Void` is never constructed
|
|
}
|
|
|
|
fn main() {
|
|
let x = Foo::Bar(42);
|
|
println!("{:?}", x);
|
|
}
|