]> git.proxmox.com Git - rustc.git/blob - tests/ui/derive-uninhabited-enum-38885.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / derive-uninhabited-enum-38885.rs
1 // check-pass
2 // compile-flags: -Wunused
3
4 // ensure there are no special warnings about uninhabited types
5 // when deriving Debug on an empty enum
6
7 #[derive(Debug)]
8 enum Void {}
9
10 #[derive(Debug)]
11 enum Foo {
12 Bar(u8),
13 Void(Void), //~ WARN variant `Void` is never constructed
14 }
15
16 fn main() {
17 let x = Foo::Bar(42);
18 println!("{:?}", x);
19 }