2017-01-19 23:17:48 -08:00
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:19:13
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | fn bad1() { unsafe {} }
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:7:9
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | #![deny(unused_unsafe)]
|
2017-01-19 23:17:48 -08:00
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:20:13
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | fn bad2() { unsafe { bad1() } }
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:21:20
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | unsafe fn bad3() { unsafe {} }
|
2017-12-17 23:48:59 -08:00
|
|
|
| ---------------- ^^^^^^ unnecessary `unsafe` block
|
|
|
|
| |
|
|
|
|
| because it's nested under this `unsafe` fn
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:22:13
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | fn bad4() { unsafe { callback(||{}) } }
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:23:20
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | unsafe fn bad5() { unsafe { unsf() } }
|
2017-12-17 23:48:59 -08:00
|
|
|
| ---------------- ^^^^^^ unnecessary `unsafe` block
|
|
|
|
| |
|
|
|
|
| because it's nested under this `unsafe` fn
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:26:9
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | unsafe { // don't put the warning here
|
2017-12-17 23:48:59 -08:00
|
|
|
| ------ because it's nested under this `unsafe` block
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | unsafe {
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:32:5
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | unsafe fn bad7() {
|
2017-12-17 23:48:59 -08:00
|
|
|
| ---------------- because it's nested under this `unsafe` fn
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | unsafe {
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
|
|
error: unnecessary `unsafe` block
|
2021-05-27 20:37:49 +02:00
|
|
|
--> $DIR/lint-unused-unsafe.rs:33:9
|
2017-01-19 23:17:48 -08:00
|
|
|
|
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | unsafe fn bad7() {
|
2017-12-17 23:48:59 -08:00
|
|
|
| ---------------- because it's nested under this `unsafe` fn
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | unsafe {
|
|
|
|
LL | unsafe {
|
2017-12-17 23:48:59 -08:00
|
|
|
| ^^^^^^ unnecessary `unsafe` block
|
2017-01-19 23:17:48 -08:00
|
|
|
|
2017-07-02 13:49:30 +03:00
|
|
|
error: aborting due to 8 previous errors
|
2017-01-19 23:17:48 -08:00
|
|
|
|