1 error: static of uninhabited type
2 --> $DIR/uninhabited-static.rs:6:5
4 LL | static VOID: Void;
7 note: the lint level is defined here
8 --> $DIR/uninhabited-static.rs:2:9
10 LL | #![deny(uninhabited_static)]
12 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13 = note: for more information, see issue #74840 <https://github.com/rust-lang/rust/issues/74840>
14 = note: uninhabited statics cannot be initialized, and any access would be an immediate error
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: `#[warn(invalid_value)]` on by default
62 = note: enums with no variants have no valid value
64 error[E0080]: could not evaluate static initializer
65 --> $DIR/uninhabited-static.rs:16:32
67 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
68 | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
70 warning: the type `Void` does not permit zero-initialization
71 --> $DIR/uninhabited-static.rs:16:32
73 LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
74 | ^^^^^^^^^^^^^^^^^^^^^^^
76 | this code causes undefined behavior when executed
77 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
79 = note: enums with no variants have no valid value
81 error: aborting due to 6 previous errors; 2 warnings emitted
83 For more information about this error, try `rustc --explain E0080`.