Skip to content

Commit d0a307b

Browse files
committed
moved renamed docs stderr formatted | derive-uninhabited-enum-38885.rs
1 parent 86f20d9 commit d0a307b

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

tests/ui/derive-uninhabited-enum-38885.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//! Regression test for derive(Debug) on enums with uninhabited variants.
2+
//!
3+
//! Ensures there are no special warnings about uninhabited types when deriving
4+
//! Debug on an enum with uninhabited variants, only standard unused warnings.
5+
//!
6+
//! Issue: https://github.com/rust-lang/rust/issues/38885
7+
8+
//@ check-pass
9+
//@ compile-flags: -Wunused
10+
11+
#[derive(Debug)]
12+
enum Void {}
13+
14+
#[derive(Debug)]
15+
enum Foo {
16+
Bar(#[allow(dead_code)] u8),
17+
Void(Void), //~ WARN variant `Void` is never constructed
18+
}
19+
20+
fn main() {
21+
let x = Foo::Bar(42);
22+
println!("{:?}", x);
23+
}

tests/ui/derive-uninhabited-enum-38885.stderr renamed to tests/ui/derives/derive-debug-uninhabited-enum.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: variant `Void` is never constructed
2-
--> $DIR/derive-uninhabited-enum-38885.rs:13:5
2+
--> $DIR/derive-debug-uninhabited-enum.rs:17:5
33
|
44
LL | enum Foo {
55
| --- variant in this enum

0 commit comments

Comments
 (0)