]> git.lizzy.rs Git - rust.git/blob - tests/ui/derive-uninhabited-enum-38885.rs
Rollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr
[rust.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 }