Skip to content

Commit 0b41875

Browse files
committed
Improved message
1 parent 22cfdfa commit 0b41875

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

clippy_lints/src/undocumented_unsafe_blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ fn check_has_safety_comment(cx: &LateContext<'_>, item: &hir::Item<'_>, (span, h
263263
UNNECESSARY_SAFETY_COMMENT,
264264
span,
265265
format!(
266-
"{} has safety comment, but maybe a `# Safety` segment would be better",
266+
"{} has unnecessary safety comment",
267267
cx.tcx.def_descr(item.owner_id.to_def_id()),
268268
),
269269
|diag| {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ help: consider removing the safety comment
426426
LL | // SAFETY: ...
427427
| ^^^^^^^^^^^^^^
428428

429-
error: function has safety comment, but maybe a `# Safety` segment would be better
429+
error: function has unnecessary safety comment
430430
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:781:5
431431
|
432432
LL | unsafe fn unsafe_comment() {}
@@ -438,7 +438,7 @@ help: consider changing the `SAFETY` comment for a `# Safety` doc comment
438438
LL | // SAFETY: Bla
439439
| ^^^^^^^^^^^^^^
440440

441-
error: function has safety comment, but maybe a `# Safety` segment would be better
441+
error: function has unnecessary safety comment
442442
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:787:5
443443
|
444444
LL | unsafe fn unsafe_block_comment() {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ LL | unsafe {}
490490
|
491491
= help: consider adding a safety comment on the preceding line
492492

493-
error: function has safety comment, but maybe a `# Safety` segment would be better
493+
error: function has unnecessary safety comment
494494
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:781:5
495495
|
496496
LL | unsafe fn unsafe_comment() {}
@@ -502,7 +502,7 @@ help: consider changing the `SAFETY` comment for a `# Safety` doc comment
502502
LL | // SAFETY: Bla
503503
| ^^^^^^^^^^^^^^
504504

505-
error: function has safety comment, but maybe a `# Safety` segment would be better
505+
error: function has unnecessary safety comment
506506
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:787:5
507507
|
508508
LL | unsafe fn unsafe_block_comment() {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: function has safety comment, but maybe a `# Safety` segment would be better
1+
error: function has unnecessary safety comment
22
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks_fixable.rs:10:5
33
|
44
LL | /// SAFETY: Bla
@@ -9,7 +9,7 @@ LL | unsafe fn unsafe_doc_comment() {}
99
= note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
1010
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
1111

12-
error: function has safety comment, but maybe a `# Safety` segment would be better
12+
error: function has unnecessary safety comment
1313
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks_fixable.rs:16:5
1414
|
1515
LL | * SAFETY: Bla

tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks_fixable.disabled.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: function has safety comment, but maybe a `# Safety` segment would be better
1+
error: function has unnecessary safety comment
22
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks_fixable.rs:10:5
33
|
44
LL | /// SAFETY: Bla
@@ -9,7 +9,7 @@ LL | unsafe fn unsafe_doc_comment() {}
99
= note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
1010
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
1111

12-
error: function has safety comment, but maybe a `# Safety` segment would be better
12+
error: function has unnecessary safety comment
1313
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks_fixable.rs:16:5
1414
|
1515
LL | * SAFETY: Bla

0 commit comments

Comments
 (0)