2020-04-20 00:27:28 +00:00
|
|
|
//@ check-pass
|
2018-11-01 02:57:37 +00:00
|
|
|
//@ compile-flags: -Wunused
|
|
|
|
|
|
|
|
// ensure there are no special warnings about uninhabited types
|
|
|
|
// when deriving Debug on an empty enum
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
2019-08-06 02:23:46 +00:00
|
|
|
enum Void {}
|
2018-11-01 02:57:37 +00:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
2019-08-06 02:23:46 +00:00
|
|
|
enum Foo {
|
2023-12-27 22:11:58 +00:00
|
|
|
Bar(#[allow(dead_code)] u8),
|
2022-06-10 03:14:24 +00:00
|
|
|
Void(Void), //~ WARN variant `Void` is never constructed
|
2018-11-01 02:57:37 +00:00
|
|
|
}
|
|
|
|
|
2019-08-06 02:23:46 +00:00
|
|
|
fn main() {
|
|
|
|
let x = Foo::Bar(42);
|
|
|
|
println!("{:?}", x);
|
|
|
|
}
|