Skip to content

Commit 45b4256

Browse files
committed
Auto merge of #143287 - GuillaumeGomez:rollup-fdjcti9, r=GuillaumeGomez
Rollup of 12 pull requests Successful merges: - rust-lang/rust#136801 (Implement `Random` for tuple) - rust-lang/rust#141867 (Describe Future invariants more precisely) - rust-lang/rust#142760 (docs(fs): Touch up grammar on lock api) - rust-lang/rust#143181 (Improve testing and error messages for malformed attributes) - rust-lang/rust#143210 (`tests/ui`: A New Order [19/N] ) - rust-lang/rust#143212 (`tests/ui`: A New Order [20/N]) - rust-lang/rust#143230 ([COMPILETEST-UNTANGLE 2/N] Make some compiletest errors/warnings/help more visually obvious) - rust-lang/rust#143240 (Port `#[rustc_object_lifetime_default]` to the new attribute parsing …) - rust-lang/rust#143255 (Do not enable LLD by default in the dist profile) - rust-lang/rust#143262 (mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`) - rust-lang/rust#143269 (bootstrap: make comment more clear) - rust-lang/rust#143279 (Remove `ItemKind::descr` method) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ca924ce + 425c3a0 commit 45b4256

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

clippy_lints/src/undocumented_unsafe_blocks.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ impl<'tcx> LateLintPass<'tcx> for UndocumentedUnsafeBlocks {
256256
cx,
257257
UNNECESSARY_SAFETY_COMMENT,
258258
span,
259-
format!("{} has unnecessary safety comment", item.kind.descr()),
259+
format!(
260+
"{} has unnecessary safety comment",
261+
cx.tcx.def_descr(item.owner_id.to_def_id()),
262+
),
260263
|diag| {
261264
diag.span_help(help_span, "consider removing the safety comment");
262265
},
@@ -274,7 +277,10 @@ impl<'tcx> LateLintPass<'tcx> for UndocumentedUnsafeBlocks {
274277
cx,
275278
UNNECESSARY_SAFETY_COMMENT,
276279
span,
277-
format!("{} has unnecessary safety comment", item.kind.descr()),
280+
format!(
281+
"{} has unnecessary safety comment",
282+
cx.tcx.def_descr(item.owner_id.to_def_id()),
283+
),
278284
|diag| {
279285
diag.span_help(help_span, "consider removing the safety comment");
280286
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ LL | unsafe impl TrailingComment for () {} // SAFETY:
240240
|
241241
= help: consider adding a safety comment on the preceding line
242242

243-
error: constant item has unnecessary safety comment
243+
error: constant has unnecessary safety comment
244244
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:508:5
245245
|
246246
LL | const BIG_NUMBER: i32 = 1000000;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ LL | unsafe impl TrailingComment for () {} // SAFETY:
240240
|
241241
= help: consider adding a safety comment on the preceding line
242242

243-
error: constant item has unnecessary safety comment
243+
error: constant has unnecessary safety comment
244244
--> tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:508:5
245245
|
246246
LL | const BIG_NUMBER: i32 = 1000000;

tests/ui/unnecessary_safety_comment.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: constant item has unnecessary safety comment
1+
error: constant has unnecessary safety comment
22
--> tests/ui/unnecessary_safety_comment.rs:6:5
33
|
44
LL | const CONST: u32 = 0;
@@ -12,7 +12,7 @@ LL | // SAFETY:
1212
= note: `-D clippy::unnecessary-safety-comment` implied by `-D warnings`
1313
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
1414

15-
error: static item has unnecessary safety comment
15+
error: static has unnecessary safety comment
1616
--> tests/ui/unnecessary_safety_comment.rs:10:5
1717
|
1818
LL | static STATIC: u32 = 0;

0 commit comments

Comments
 (0)