File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 33
44const fn foo ( ) -> ! {
55 unsafe { std:: mem:: transmute ( ( ) ) }
6- //~^ WARN any use of this value will cause an error [const_err]
6+ //~^ ERROR evaluation of constant value failed
77 //~| WARN the type `!` does not permit zero-initialization [invalid_value]
88}
99
@@ -12,7 +12,7 @@ enum Empty { }
1212
1313#[ warn( const_err) ]
1414const FOO : [ Empty ; 3 ] = [ foo ( ) ; 3 ] ;
15-
15+ //~^ WARN any use of this value will cause an error
1616#[ warn( const_err) ]
1717const BAR : [ Empty ; 3 ] = [ unsafe { std:: mem:: transmute ( ( ) ) } ; 3 ] ;
1818//~^ 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
22 --> $DIR/validate_uninhabited_zsts.rs:5:14
33 |
44LL | 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+ |
1010LL | const FOO: [Empty; 3] = [foo(); 3];
11- | -----------------------------------
11+ | -------------------------^^^^^-----
12+ | |
13+ | referenced constant has errors
1214 |
1315note: lint level defined here
1416 --> $DIR/validate_uninhabited_zsts.rs:13:8
@@ -47,6 +49,6 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
4749 |
4850 = note: 0-variant enums have no valid value
4951
50- error: aborting due to previous error
52+ error: aborting due to 2 previous errors
5153
5254For 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") };
66
77error: aborting due to previous error
88
9- For more information about this error, try `rustc --explain E0727`.
You can’t perform that action at this time.
0 commit comments