File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 99 //~| WARN: previously accepted
1010}
1111
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+
1217fn main ( ) { }
Original file line number Diff line number Diff line change @@ -23,5 +23,25 @@ LL | static NEVER: !;
2323 = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
2424 = note: uninhabited statics cannot be initialized, and any access would be an immediate error
2525
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
2747
You can’t perform that action at this time.
0 commit comments