Auto merge of #7891 - giraffate:fix_ice_for_undocumented_unsafe_blocks, r=flip1995
Fix ice in `undocumented_unsafe_blocks` Fix https://github.com/rust-lang/rust-clippy/issues/7868 changelog: Fix ice in [`undocumented_unsafe_blocks`]
This commit is contained in:
commit
7788af9c47
4 changed files with 28 additions and 2 deletions
3
tests/ui/crashes/auxiliary/ice-7868-aux.rs
Normal file
3
tests/ui/crashes/auxiliary/ice-7868-aux.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn zero() {
|
||||
unsafe { 0 };
|
||||
}
|
||||
7
tests/ui/crashes/ice-7868.rs
Normal file
7
tests/ui/crashes/ice-7868.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![warn(clippy::undocumented_unsafe_blocks)]
|
||||
#![allow(clippy::no_effect)]
|
||||
|
||||
#[path = "auxiliary/ice-7868-aux.rs"]
|
||||
mod zero;
|
||||
|
||||
fn main() {}
|
||||
15
tests/ui/crashes/ice-7868.stderr
Normal file
15
tests/ui/crashes/ice-7868.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: unsafe block missing a safety comment
|
||||
--> $DIR/auxiliary/ice-7868-aux.rs:2:5
|
||||
|
|
||||
LL | unsafe { 0 };
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
|
||||
help: consider adding a safety comment
|
||||
|
|
||||
LL ~ // Safety: ...
|
||||
LL ~ unsafe { 0 };
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue