File tree 3 files changed +12
-11
lines changed
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 3
3
4
4
const fn foo ( ) -> ! {
5
5
unsafe { std:: mem:: transmute ( ( ) ) }
6
- //~^ WARN any use of this value will cause an error [const_err]
6
+ //~^ ERROR evaluation of constant value failed
7
7
//~| WARN the type `!` does not permit zero-initialization [invalid_value]
8
8
}
9
9
@@ -12,7 +12,7 @@ enum Empty { }
12
12
13
13
#[ warn( const_err) ]
14
14
const FOO : [ Empty ; 3 ] = [ foo ( ) ; 3 ] ;
15
-
15
+ //~^ WARN any use of this value will cause an error
16
16
#[ warn( const_err) ]
17
17
const BAR : [ Empty ; 3 ] = [ unsafe { std:: mem:: transmute ( ( ) ) } ; 3 ] ;
18
18
//~^ ERROR it is undefined behavior to use this value
Original file line number Diff line number Diff line change 1
- warning: any use of this value will cause an error
1
+ error[E0080]: evaluation of constant value failed
2
2
--> $DIR/validate_uninhabited_zsts.rs:5:14
3
3
|
4
4
LL | unsafe { std::mem::transmute(()) }
5
- | ^^^^^^^^^^^^^^^^^^^^^^^
6
- | |
7
- | entering unreachable code
8
- | inside call to `foo` at $DIR/validate_uninhabited_zsts.rs:14:26
9
- ...
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
6
+
7
+ warning: any use of this value will cause an error
8
+ --> $DIR/validate_uninhabited_zsts.rs:14:26
9
+ |
10
10
LL | const FOO: [Empty; 3] = [foo(); 3];
11
- | -----------------------------------
11
+ | -------------------------^^^^^-----
12
+ | |
13
+ | referenced constant has errors
12
14
|
13
15
note: lint level defined here
14
16
--> $DIR/validate_uninhabited_zsts.rs:13:8
@@ -47,6 +49,6 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
47
49
|
48
50
= note: 0-variant enums have no valid value
49
51
50
- error: aborting due to previous error
52
+ error: aborting due to 2 previous errors
51
53
52
54
For more information about this error, try `rustc --explain E0080`.
Original file line number Diff line number Diff line change @@ -6,4 +6,3 @@ LL | async { yield print!(":C") };
6
6
7
7
error: aborting due to previous error
8
8
9
- For more information about this error, try `rustc --explain E0727`.
You can’t perform that action at this time.
0 commit comments