2017-11-05 12:04:18 -06:00
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:17:13
|
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
17 | / unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
18 | | v.set_len(24);
|
2017-11-20 06:13:27 -06:00
|
|
|
19 | | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
20 | | w.set_len(32);
|
|
|
|
21 | | } };
|
|
|
|
22 | | }
|
|
|
|
| |_____________^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:11:8
|
|
|
|
|
|
|
|
|
11 | #[deny(unused_unsafe)]
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
note: because it's nested under this `unsafe` block
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
|
|
|
|
|
|
|
|
15 | / unsafe {
|
|
|
|
16 | | let f = |v: &mut Vec<_>| {
|
2017-11-20 06:13:27 -06:00
|
|
|
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
18 | | v.set_len(24);
|
|
|
|
... |
|
|
|
|
29 | | f(&mut v);
|
|
|
|
30 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:19:38
|
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
19 | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
| ______________________________________^
|
|
|
|
20 | | w.set_len(32);
|
|
|
|
21 | | } };
|
|
|
|
| |_________________^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` block
|
2017-11-14 08:01:50 -06:00
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
2017-11-05 12:04:18 -06:00
|
|
|
|
|
2017-11-14 08:01:50 -06:00
|
|
|
15 | / unsafe {
|
|
|
|
16 | | let f = |v: &mut Vec<_>| {
|
2017-11-20 06:13:27 -06:00
|
|
|
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
18 | | v.set_len(24);
|
2017-11-14 08:01:50 -06:00
|
|
|
... |
|
|
|
|
29 | | f(&mut v);
|
|
|
|
30 | | }
|
|
|
|
| |_____^
|
2017-11-05 12:04:18 -06:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:23:34
|
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
23 | |x: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
| __________________________________^
|
|
|
|
24 | | x.set_len(40);
|
|
|
|
25 | | } };
|
|
|
|
| |_____________^ unnecessary `unsafe` block
|
|
|
|
|
|
|
|
|
note: because it's nested under this `unsafe` block
|
|
|
|
--> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:15:5
|
|
|
|
|
|
|
|
|
15 | / unsafe {
|
|
|
|
16 | | let f = |v: &mut Vec<_>| {
|
2017-11-20 06:13:27 -06:00
|
|
|
17 | | unsafe { //~ ERROR unnecessary `unsafe`
|
2017-11-05 12:04:18 -06:00
|
|
|
18 | | v.set_len(24);
|
|
|
|
... |
|
|
|
|
29 | | f(&mut v);
|
|
|
|
30 | | }
|
|
|
|
| |_____^
|
|
|
|
|
2017-11-14 08:01:50 -06:00
|
|
|
error: aborting due to 3 previous errors
|
2017-11-05 12:04:18 -06:00
|
|
|
|