mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
41e8d152dc
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
24 lines
657 B
Text
24 lines
657 B
Text
error: unreachable statement
|
|
--> $DIR/issue-7246.rs:7:5
|
|
|
|
|
LL | return;
|
|
| ------ any code following this expression is unreachable
|
|
LL | if *ptr::null() {};
|
|
| ^^^^^^^^^^^^^^^^^^^ unreachable statement
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/issue-7246.rs:1:9
|
|
|
|
|
LL | #![deny(unreachable_code)]
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
warning: dereferencing a null pointer
|
|
--> $DIR/issue-7246.rs:7:8
|
|
|
|
|
LL | if *ptr::null() {};
|
|
| ^^^^^^^^^^^^ this code causes undefined behavior when executed
|
|
|
|
|
= note: `#[warn(deref_nullptr)]` on by default
|
|
|
|
error: aborting due to 1 previous error; 1 warning emitted
|
|
|