Rollup merge of #137454 - mu001999-contrib:fix-137414, r=wesleywiser
not lint break with label and unsafe block fixes #137414 we can't label unsafe blocks, so that we can do not lint them
This commit is contained in:
commit
db98b72e34
2 changed files with 19 additions and 6 deletions
11
tests/ui/lint/break-with-label-and-unsafe-block.rs
Normal file
11
tests/ui/lint/break-with-label-and-unsafe-block.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
//@ check-pass
|
||||
|
||||
#![deny(break_with_label_and_loop)]
|
||||
|
||||
unsafe fn foo() -> i32 { 42 }
|
||||
|
||||
fn main () {
|
||||
'label: loop {
|
||||
break 'label unsafe { foo() }
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue