1 error: static of uninhabited type
2 --> $DIR/uninhabited-static.rs:6:5
4 LL | static VOID: Void;
7 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8 = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
9 = note: uninhabited statics cannot be initialized, and any access would be an immediate error
10 note: the lint level is defined here
11 --> $DIR/uninhabited-static.rs:2:9
13 LL | #![deny(uninhabited_static)]
16 error: static of uninhabited type
17 --> $DIR/uninhabited-static.rs:8:5
22 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
23 = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
24 = note: uninhabited statics cannot be initialized, and any access would be an immediate error
26 error: static of uninhabited type
27 --> $DIR/uninhabited-static.rs:12:1
29 LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
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
36 error: static of uninhabited type
37 --> $DIR/uninhabited-static.rs:16:1
39 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
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
46 error[E0080]: could not evaluate static initializer
47 --> $DIR/uninhabited-static.rs:12:31
49 LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
50 | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
52 warning: the type `Void` does not permit zero-initialization
53 --> $DIR/uninhabited-static.rs:12:31
55 LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
56 | ^^^^^^^^^^^^^^^^^^^^^^^
58 | this code causes undefined behavior when executed
59 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
61 note: enums with no inhabited variants have no valid value
62 --> $DIR/uninhabited-static.rs:4:1
66 = note: `#[warn(invalid_value)]` on by default
68 error[E0080]: could not evaluate static initializer
69 --> $DIR/uninhabited-static.rs:16:32
71 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
72 | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
74 warning: the type `Void` does not permit zero-initialization
75 --> $DIR/uninhabited-static.rs:16:32
77 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
78 | ^^^^^^^^^^^^^^^^^^^^^^^
80 | this code causes undefined behavior when executed
81 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
83 note: enums with no inhabited variants have no valid value
84 --> $DIR/uninhabited-static.rs:4:1
89 error: aborting due to 6 previous errors; 2 warnings emitted
91 For more information about this error, try `rustc --explain E0080`.