mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
422 lines
13 KiB
Text
422 lines
13 KiB
Text
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:262:19
|
|
|
|
|
LL | /* Safety: */ unsafe {}
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:266:5
|
|
|
|
|
LL | unsafe {}
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:270:14
|
|
|
|
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:270:29
|
|
|
|
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:270:48
|
|
|
|
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:274:18
|
|
|
|
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:274:37
|
|
|
|
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:278:14
|
|
|
|
|
LL | let _ = *unsafe { &42 };
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:283:19
|
|
|
|
|
LL | let _ = match unsafe {} {
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:289:14
|
|
|
|
|
LL | let _ = &unsafe {};
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:293:14
|
|
|
|
|
LL | let _ = [unsafe {}; 5];
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:297:13
|
|
|
|
|
LL | let _ = unsafe {};
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:307:8
|
|
|
|
|
LL | t!(unsafe {});
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:313:13
|
|
|
|
|
LL | unsafe {}
|
|
| ^^^^^^^^^
|
|
...
|
|
LL | t!();
|
|
| ---- in this macro invocation
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:321:5
|
|
|
|
|
LL | unsafe {} // SAFETY:
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:325:5
|
|
|
|
|
LL | unsafe {
|
|
| ^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:335:5
|
|
|
|
|
LL | unsafe {};
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:339:20
|
|
|
|
|
LL | println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:346:5
|
|
|
|
|
LL | unsafe impl A for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:353:9
|
|
|
|
|
LL | unsafe impl B for (u32) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:374:13
|
|
|
|
|
LL | unsafe impl T for $t {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | no_safety_comment!(());
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:399:13
|
|
|
|
|
LL | unsafe impl T for $t {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | no_safety_comment!(());
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:407:5
|
|
|
|
|
LL | unsafe impl T for (i32) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:399:13
|
|
|
|
|
LL | unsafe impl T for $t {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | no_safety_comment!(u32);
|
|
| ----------------------- in this macro invocation
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:413:5
|
|
|
|
|
LL | unsafe impl T for (bool) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:459:5
|
|
|
|
|
LL | unsafe impl NoComment for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:463:19
|
|
|
|
|
LL | /* SAFETY: */ unsafe impl InlineComment for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:467:5
|
|
|
|
|
LL | unsafe impl TrailingComment for () {} // SAFETY:
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: constant item has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:471:5
|
|
|
|
|
LL | const BIG_NUMBER: i32 = 1000000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:470:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
= note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:472:5
|
|
|
|
|
LL | unsafe impl Interference for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: constant item has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:477:5
|
|
|
|
|
LL | const CONST: u32 = 0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:476:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
|
|
error: static item has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:479:5
|
|
|
|
|
LL | static STATIC: u32 = 0;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:478:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
|
|
error: struct has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:481:5
|
|
|
|
|
LL | struct Struct;
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:480:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
|
|
error: enum has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:483:5
|
|
|
|
|
LL | enum Enum {}
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:482:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
|
|
error: module has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:485:5
|
|
|
|
|
LL | mod module {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:484:5
|
|
|
|
|
LL | // SAFETY:
|
|
| ^^^^^^^^^^
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:492:5
|
|
|
|
|
LL | unsafe impl ImplInFn for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe impl missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:501:1
|
|
|
|
|
LL | unsafe impl CrateRoot for () {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:511:9
|
|
|
|
|
LL | unsafe {};
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: statement has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:514:5
|
|
|
|
|
LL | / let _ = {
|
|
LL | | if unsafe { true } {
|
|
LL | | todo!();
|
|
LL | | } else {
|
|
... |
|
|
LL | | }
|
|
LL | | };
|
|
| |______^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:513:5
|
|
|
|
|
LL | // SAFETY: this is more than one level away, so it should warn
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:515:12
|
|
|
|
|
LL | if unsafe { true } {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: unsafe block missing a safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:518:23
|
|
|
|
|
LL | let bar = unsafe {};
|
|
| ^^^^^^^^^
|
|
|
|
|
= help: consider adding a safety comment on the preceding line
|
|
|
|
error: impl has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:541:13
|
|
|
|
|
LL | impl T for $t {}
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | with_safety_comment!(i32);
|
|
| ------------------------- in this macro invocation
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:540:13
|
|
|
|
|
LL | // Safety: unnecessary
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
= note: this error originates in the macro `with_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: expression has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:553:5
|
|
|
|
|
LL | 24
|
|
| ^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:552:5
|
|
|
|
|
LL | // SAFETY: unnecessary
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: statement has unnecessary safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:550:5
|
|
|
|
|
LL | let num = 42;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
help: consider removing the safety comment
|
|
--> $DIR/undocumented_unsafe_blocks.rs:549:5
|
|
|
|
|
LL | // SAFETY: unnecessary
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 44 previous errors
|
|
|