1
1
warning: 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
3
3
|
4
4
LL | unsafe { std::mem::transmute(()) }
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^
6
6
| |
7
7
| 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
10
10
...
11
11
LL | const FOO: [Empty; 3] = [foo(); 3];
12
12
| -----------------------------------
13
13
|
14
14
note: the lint level is defined here
15
- --> $DIR/validate_uninhabited_zsts.rs:15 :8
15
+ --> $DIR/validate_uninhabited_zsts.rs:14 :8
16
16
|
17
17
LL | #[warn(const_err)]
18
18
| ^^^^^^^^^
19
19
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
20
20
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
21
21
22
22
error[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
24
24
|
25
25
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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];
29
29
= note: the raw bytes of the constant (size: 0, align: 1) {}
30
30
31
31
warning: the type `!` does not permit zero-initialization
32
- --> $DIR/validate_uninhabited_zsts.rs:6 :14
32
+ --> $DIR/validate_uninhabited_zsts.rs:5 :14
33
33
|
34
34
LL | unsafe { std::mem::transmute(()) }
35
35
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@ LL | unsafe { std::mem::transmute(()) }
41
41
= note: the `!` type has no valid value
42
42
43
43
warning: the type `Empty` does not permit zero-initialization
44
- --> $DIR/validate_uninhabited_zsts.rs:19 :35
44
+ --> $DIR/validate_uninhabited_zsts.rs:18 :35
45
45
|
46
46
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
47
47
| ^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments