11warning: any use of this value will cause an error
2- --> $DIR/validate_uninhabited_zsts.rs:6 :14
2+ --> $DIR/validate_uninhabited_zsts.rs:5 :14
33 |
44LL | unsafe { std::mem::transmute(()) }
55 | ^^^^^^^^^^^^^^^^^^^^^^^
66 | |
77 | transmuting to uninhabited type
8- | inside `foo` at $DIR/validate_uninhabited_zsts.rs:6 :14
9- | inside `FOO` at $DIR/validate_uninhabited_zsts.rs:16 :26
8+ | inside `foo` at $DIR/validate_uninhabited_zsts.rs:5 :14
9+ | inside `FOO` at $DIR/validate_uninhabited_zsts.rs:15 :26
1010...
1111LL | const FOO: [Empty; 3] = [foo(); 3];
1212 | -----------------------------------
1313 |
1414note: the lint level is defined here
15- --> $DIR/validate_uninhabited_zsts.rs:15 :8
15+ --> $DIR/validate_uninhabited_zsts.rs:14 :8
1616 |
1717LL | #[warn(const_err)]
1818 | ^^^^^^^^^
1919 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2020 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
2121
2222error[E0080]: it is undefined behavior to use this value
23- --> $DIR/validate_uninhabited_zsts.rs:19 :1
23+ --> $DIR/validate_uninhabited_zsts.rs:18 :1
2424 |
2525LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Empty at [0]
@@ -29,7 +29,7 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
2929 = note: the raw bytes of the constant (size: 0, align: 1) {}
3030
3131warning: the type `!` does not permit zero-initialization
32- --> $DIR/validate_uninhabited_zsts.rs:6 :14
32+ --> $DIR/validate_uninhabited_zsts.rs:5 :14
3333 |
3434LL | unsafe { std::mem::transmute(()) }
3535 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@ LL | unsafe { std::mem::transmute(()) }
4141 = note: the `!` type has no valid value
4242
4343warning: the type `Empty` does not permit zero-initialization
44- --> $DIR/validate_uninhabited_zsts.rs:19 :35
44+ --> $DIR/validate_uninhabited_zsts.rs:18 :35
4545 |
4646LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
4747 | ^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments