Don't warn about unsafe functions which don't need to be unsafe
This commit is contained in:
parent
2b09267b76
commit
3c2a44b60f
2 changed files with 3 additions and 17 deletions
|
|
@ -18,9 +18,7 @@ fn callback<T>(_f: &fn() -> T) -> T { fail!() }
|
|||
|
||||
fn bad1() { unsafe {} } //~ ERROR: unnecessary "unsafe" block
|
||||
fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary "unsafe" block
|
||||
unsafe fn bad3() {} //~ ERROR: unnecessary "unsafe" function
|
||||
unsafe fn bad4() { unsafe {} } //~ ERROR: unnecessary "unsafe" function
|
||||
//~^ ERROR: unnecessary "unsafe" block
|
||||
unsafe fn bad4() { unsafe {} } //~ ERROR: unnecessary "unsafe" block
|
||||
fn bad5() { unsafe { do callback {} } } //~ ERROR: unnecessary "unsafe" block
|
||||
|
||||
unsafe fn good0() { libc::exit(1) }
|
||||
|
|
@ -38,7 +36,6 @@ fn good2() {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_unsafe)] unsafe fn allowed0() {}
|
||||
#[allow(unused_unsafe)] fn allowed1() { unsafe {} }
|
||||
#[allow(unused_unsafe)] fn allowed() { unsafe {} }
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue