fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1warning: the type `!` does not permit zero-initialization 2 --> $DIR/validate_uninhabited_zsts.rs:4:14 3 | 4LL | unsafe { std::mem::transmute(()) } 5 | ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed 6 | 7 = note: the `!` type has no valid value 8 = note: `#[warn(invalid_value)]` on by default 9 10error[E0080]: evaluation of constant value failed 11 --> $DIR/validate_uninhabited_zsts.rs:4:14 12 | 13LL | unsafe { std::mem::transmute(()) } 14 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!` 15 | 16note: inside `foo` 17 --> $DIR/validate_uninhabited_zsts.rs:4:14 18 | 19LL | unsafe { std::mem::transmute(()) } 20 | ^^^^^^^^^^^^^^^^^^^^^^^ 21note: inside `FOO` 22 --> $DIR/validate_uninhabited_zsts.rs:19:33 23 | 24LL | const FOO: [empty::Empty; 3] = [foo(); 3]; 25 | ^^^^^ 26 27error[E0080]: evaluation of constant value failed 28 --> $DIR/validate_uninhabited_zsts.rs:21:42 29 | 30LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; 31 | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void` 32 33warning: the type `empty::Empty` does not permit zero-initialization 34 --> $DIR/validate_uninhabited_zsts.rs:21:42 35 | 36LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; 37 | ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed 38 | 39note: in this struct field 40 --> $DIR/validate_uninhabited_zsts.rs:16:22 41 | 42LL | pub struct Empty(Void); 43 | ^^^^ 44note: enums with no inhabited variants have no valid value 45 --> $DIR/validate_uninhabited_zsts.rs:13:5 46 | 47LL | enum Void {} 48 | ^^^^^^^^^ 49 50error: aborting due to 2 previous errors; 2 warnings emitted 51 52For more information about this error, try `rustc --explain E0080`.