]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-48131.rs
b3cc350acf532c8ddd2c065ebbd90734656e7bab
[rust.git] / src / test / ui / issues / issue-48131.rs
1 // This note is annotated because the purpose of the test
2 // is to ensure that certain other notes are not generated.
3 #![deny(unused_unsafe)] //~ NOTE
4
5 // (test that no note is generated on this unsafe fn)
6 pub unsafe fn a() {
7     fn inner() {
8         unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe`
9                                      //~^ NOTE
10     }
11
12     inner()
13 }
14
15 pub fn b() {
16     // (test that no note is generated on this unsafe block)
17     unsafe {
18         fn inner() {
19             unsafe { /* unnecessary */ } //~ ERROR unnecessary `unsafe`
20                                          //~^ NOTE
21         }
22
23         let () = ::std::mem::uninitialized();
24
25         inner()
26     }
27 }
28
29 fn main() {}