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 6
6
7
7
fn main ( ) {
8
8
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
13
11
}
14
12
15
13
fn f ( x : !) -> ! {
Original file line number Diff line number Diff line change 1
1
error: Undefined Behavior: entering unreachable code
2
2
--> $DIR/never_say_never.rs:LL:CC
3
3
|
4
- LL | *(y as *const _ as *const ! )
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ entering unreachable code
4
+ LL | f(x )
5
+ | ^^^^ entering unreachable code
6
6
|
7
7
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
8
= 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