rust/src/test/ui/issues/issue-7246.stderr
Joshua Nelson 0ac13bd430 Don't abort compilation after giving a lint error
The only reason to use `abort_if_errors` is when the program is so broken that either:
1. later passes get confused and ICE
2. any diagnostics from later passes would be noise

This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints.
So it can continue to lint and compile even if there are lint errors.
2021-11-08 01:22:28 +00:00

25 lines
655 B
Plaintext

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 previous error; 1 warning emitted