File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 66
77fn main ( ) {
88 let y = & 5 ;
9- let x: ! = unsafe {
10- * ( y as * const _ as * const !) //~ ERROR: entering unreachable code
11- } ;
12- f ( x)
9+ let x: ! = unsafe { * ( y as * const _ as * const !) } ;
10+ f ( x) //~ ERROR: entering unreachable code
1311}
1412
1513fn f ( x : !) -> ! {
Original file line number Diff line number Diff line change 11error: Undefined Behavior: entering unreachable code
22 --> $DIR/never_say_never.rs:LL:CC
33 |
4- LL | *(y as *const _ as *const ! )
5- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ entering unreachable code
4+ LL | f(x )
5+ | ^^^^ entering unreachable code
66 |
77 = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88 = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
You can’t perform that action at this time.
0 commit comments