Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize use of backticks in compiler messages for librustc_lint #62810

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
if !self.impling_types.as_ref().unwrap().contains(&item.hir_id) {
cx.span_lint(MISSING_DEBUG_IMPLEMENTATIONS,
item.span,
"type does not implement `fmt::Debug`; consider adding #[derive(Debug)] \
"type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` \
or a manual implementation")
}
}
Expand Down Expand Up @@ -867,7 +867,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidNoMangleItems {
if attr::contains_name(&it.attrs, sym::no_mangle) {
// Const items do not refer to a particular location in memory, and therefore
// don't have anything to attach a symbol to
let msg = "const items should never be #[no_mangle]";
let msg = "const items should never be `#[no_mangle]`";
let mut err = cx.struct_span_lint(NO_MANGLE_CONST_ITEMS, it.span, msg);

// account for "pub const" (#45562)
Expand Down Expand Up @@ -1358,7 +1358,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
declare_lint! {
UNNAMEABLE_TEST_ITEMS,
Warn,
"detects an item that cannot be named being marked as #[test_case]",
"detects an item that cannot be named being marked as `#[test_case]`",
report_in_external_macro: true
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
store.register_removed("resolve_trait_on_defaulted_unit",
"converted into hard error, see https://github.com/rust-lang/rust/issues/48950");
store.register_removed("private_no_mangle_fns",
"no longer a warning, #[no_mangle] functions always exported");
"no longer a warning, `#[no_mangle]` functions always exported");
store.register_removed("private_no_mangle_statics",
"no longer a warning, #[no_mangle] statics always exported");
"no longer a warning, `#[no_mangle]` statics always exported");
store.register_removed("bad_repr",
"replaced with a generic attribute input check");
store.register_removed("duplicate_matcher_binding_name",
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_lint/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use log::debug;
declare_lint! {
pub UNUSED_MUST_USE,
Warn,
"unused result of a type flagged as #[must_use]",
"unused result of a type flagged as `#[must_use]`",
report_in_external_macro: true
}

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

let name = attr.name_or_empty();
if !attr::is_used(attr) {
debug!("Emitting warning for: {:?}", attr);
debug!("emitting warning for: {:?}", attr);
cx.span_lint(UNUSED_ATTRIBUTES, attr.span, "unused attribute");
// Is it a builtin attribute that must be used at the crate level?
let known_crate = attr_info.map(|&&(_, ty, ..)| {
Expand All @@ -332,7 +332,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
let msg = match attr.style {
ast::AttrStyle::Outer => {
"crate-level attribute should be an inner attribute: add an exclamation \
mark: #![foo]"
mark: `#![foo]`"
}
ast::AttrStyle::Inner => "crate-level attribute should be in the root module",
};
Expand Down Expand Up @@ -570,9 +570,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAllocation {
if let adjustment::Adjust::Borrow(adjustment::AutoBorrow::Ref(_, m)) = adj.kind {
let msg = match m {
adjustment::AutoBorrowMutability::Immutable =>
"unnecessary allocation, use & instead",
"unnecessary allocation, use `&` instead",
adjustment::AutoBorrowMutability::Mutable { .. }=>
"unnecessary allocation, use &mut instead"
"unnecessary allocation, use `&mut` instead"
};
cx.span_lint(UNUSED_ALLOCATION, e.span, msg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/plugin-attr-register-deny.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: lint level defined here
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^

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