Skip to content

Commit a03ba14

Browse files
committed
Added extra test case
1 parent ac20f5f commit a03ba14

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.default.stderr

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,5 +414,17 @@ help: consider removing the safety comment
414414
LL | // SAFETY: ...
415415
| ^^^^^^^^^^^^^^
416416

417-
error: aborting due to 45 previous errors
417+
error: statement has unnecessary safety comment
418+
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:773:9
419+
|
420+
LL | let x = 34;
421+
| ^^^^^^^^^^^
422+
|
423+
help: consider removing the safety comment
424+
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:771:9
425+
|
426+
LL | // SAFETY: ...
427+
| ^^^^^^^^^^^^^^
428+
429+
error: aborting due to 46 previous errors
418430

tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ mod issue_14555 {
751751
//~^ unnecessary_safety_comment
752752
}
753753

754-
mod issue_todo {
754+
mod issue_15754 {
755755
#[must_use]
756756
// SAFETY: ...
757757
#[doc(hidden)]
@@ -765,6 +765,14 @@ mod issue_todo {
765765
unsafe {}
766766
//~[disabled]^ undocumented_unsafe_blocks
767767
}
768+
769+
fn bar() {
770+
#[doc(hidden)]
771+
// SAFETY: ...
772+
#[allow(clippy::unnecessary_cast)]
773+
let x = 34;
774+
//~[default]^ unnecessary_safety_comment
775+
}
768776
}
769777

770778
fn main() {}

0 commit comments

Comments
 (0)