Skip to content

Commit 17ddfbe

Browse files
authored
Rollup merge of rust-lang#62810 - fakenine:normalize_use_of_backticks_compiler_messages_p10, r=Centril
normalize use of backticks in compiler messages for librustc_lint rust-lang#60532
2 parents 5a20745 + 0385d64 commit 17ddfbe

15 files changed

+65
-65
lines changed

src/librustc_lint/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
591591
if !self.impling_types.as_ref().unwrap().contains(&item.hir_id) {
592592
cx.span_lint(MISSING_DEBUG_IMPLEMENTATIONS,
593593
item.span,
594-
"type does not implement `fmt::Debug`; consider adding #[derive(Debug)] \
594+
"type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` \
595595
or a manual implementation")
596596
}
597597
}
@@ -867,7 +867,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidNoMangleItems {
867867
if attr::contains_name(&it.attrs, sym::no_mangle) {
868868
// Const items do not refer to a particular location in memory, and therefore
869869
// don't have anything to attach a symbol to
870-
let msg = "const items should never be #[no_mangle]";
870+
let msg = "const items should never be `#[no_mangle]`";
871871
let mut err = cx.struct_span_lint(NO_MANGLE_CONST_ITEMS, it.span, msg);
872872

873873
// account for "pub const" (#45562)
@@ -1358,7 +1358,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
13581358
declare_lint! {
13591359
UNNAMEABLE_TEST_ITEMS,
13601360
Warn,
1361-
"detects an item that cannot be named being marked as #[test_case]",
1361+
"detects an item that cannot be named being marked as `#[test_case]`",
13621362
report_in_external_macro: true
13631363
}
13641364

src/librustc_lint/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
481481
store.register_removed("resolve_trait_on_defaulted_unit",
482482
"converted into hard error, see https://github.com/rust-lang/rust/issues/48950");
483483
store.register_removed("private_no_mangle_fns",
484-
"no longer a warning, #[no_mangle] functions always exported");
484+
"no longer a warning, `#[no_mangle]` functions always exported");
485485
store.register_removed("private_no_mangle_statics",
486-
"no longer a warning, #[no_mangle] statics always exported");
486+
"no longer a warning, `#[no_mangle]` statics always exported");
487487
store.register_removed("bad_repr",
488488
"replaced with a generic attribute input check");
489489
store.register_removed("duplicate_matcher_binding_name",

src/librustc_lint/unused.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use log::debug;
2424
declare_lint! {
2525
pub UNUSED_MUST_USE,
2626
Warn,
27-
"unused result of a type flagged as #[must_use]",
27+
"unused result of a type flagged as `#[must_use]`",
2828
report_in_external_macro: true
2929
}
3030

@@ -316,7 +316,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
316316

317317
let name = attr.name_or_empty();
318318
if !attr::is_used(attr) {
319-
debug!("Emitting warning for: {:?}", attr);
319+
debug!("emitting warning for: {:?}", attr);
320320
cx.span_lint(UNUSED_ATTRIBUTES, attr.span, "unused attribute");
321321
// Is it a builtin attribute that must be used at the crate level?
322322
let known_crate = attr_info.map(|&&(_, ty, ..)| {
@@ -332,7 +332,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
332332
let msg = match attr.style {
333333
ast::AttrStyle::Outer => {
334334
"crate-level attribute should be an inner attribute: add an exclamation \
335-
mark: #![foo]"
335+
mark: `#![foo]`"
336336
}
337337
ast::AttrStyle::Inner => "crate-level attribute should be in the root module",
338338
};
@@ -570,9 +570,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAllocation {
570570
if let adjustment::Adjust::Borrow(adjustment::AutoBorrow::Ref(_, m)) = adj.kind {
571571
let msg = match m {
572572
adjustment::AutoBorrowMutability::Immutable =>
573-
"unnecessary allocation, use & instead",
573+
"unnecessary allocation, use `&` instead",
574574
adjustment::AutoBorrowMutability::Mutable { .. }=>
575-
"unnecessary allocation, use &mut instead"
575+
"unnecessary allocation, use `&mut` instead"
576576
};
577577
cx.span_lint(UNUSED_ALLOCATION, e.span, msg);
578578
}

src/test/ui-fulldeps/plugin-attr-register-deny.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: lint level defined here
1010
LL | #![deny(unused_attributes)]
1111
| ^^^^^^^^^^^^^^^^^
1212

13-
error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
13+
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
1414
--> $DIR/plugin-attr-register-deny.rs:14:5
1515
|
1616
LL | #[bar]

0 commit comments

Comments
 (0)