rust/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr

73 lines
2.3 KiB
Plaintext
Raw Normal View History

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`
18 | | v.set_len(24);
2017-11-20 06:13:27 -06:00
19 | | |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
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`
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`
| ______________________________________^
20 | | w.set_len(32);
21 | | } };
| |_________________^ 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`
18 | | v.set_len(24);
... |
29 | | f(&mut v);
30 | | }
| |_____^
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`
| __________________________________^
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`
18 | | v.set_len(24);
... |
29 | | f(&mut v);
30 | | }
| |_____^
error: aborting due to 3 previous errors