File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 9
9
//~| WARN: previously accepted
10
10
}
11
11
12
+ static VOID2 : Void = unsafe { std:: mem:: transmute ( ( ) ) } ; //~ ERROR static of uninhabited type
13
+ //~| WARN: previously accepted
14
+ static NEVER2 : Void = unsafe { std:: mem:: transmute ( ( ) ) } ; //~ ERROR static of uninhabited type
15
+ //~| WARN: previously accepted
16
+
12
17
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -23,5 +23,25 @@ LL | static NEVER: !;
23
23
= note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
24
24
= note: uninhabited statics cannot be initialized, and any access would be an immediate error
25
25
26
- error: aborting due to 2 previous errors
26
+ error: static of uninhabited type
27
+ --> $DIR/uninhabited-static.rs:12:1
28
+ |
29
+ LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31
+ |
32
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
33
+ = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
34
+ = note: uninhabited statics cannot be initialized, and any access would be an immediate error
35
+
36
+ error: static of uninhabited type
37
+ --> $DIR/uninhabited-static.rs:14:1
38
+ |
39
+ LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
40
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
+ |
42
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
43
+ = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
44
+ = note: uninhabited statics cannot be initialized, and any access would be an immediate error
45
+
46
+ error: aborting due to 4 previous errors
27
47
You can’t perform that action at this time.
0 commit comments