Skip to content

Commit 0ae9048

Browse files
Rollup merge of #62764 - fakenine:normalize_use_of_backticks_compiler_messages_p7, r=alexreg
normalize use of backticks in compiler messages for librustc/lint #60532
2 parents c4977ef + e5e1397 commit 0ae9048

File tree

149 files changed

+177
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+177
-177
lines changed

src/librustc/lint/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ declare_lint! {
9494
declare_lint! {
9595
pub UNUSED_FEATURES,
9696
Warn,
97-
"unused features found in crate-level #[feature] directives"
97+
"unused features found in crate-level `#[feature]` directives"
9898
}
9999

100100
declare_lint! {
101101
pub STABLE_FEATURES,
102102
Warn,
103-
"stable features found in #[feature] directive"
103+
"stable features found in `#[feature]` directive"
104104
}
105105

106106
declare_lint! {
107107
pub UNKNOWN_CRATE_TYPES,
108108
Deny,
109-
"unknown crate type found in #[crate_type] directive"
109+
"unknown crate type found in `#[crate_type]` directive"
110110
}
111111

112112
declare_lint! {

src/librustc/lint/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
671671
sess.diag_note_once(
672672
&mut err,
673673
DiagnosticMessageId::from(lint),
674-
&format!("#[{}({})] on by default", level.as_str(), name));
674+
&format!("`#[{}({})]` on by default", level.as_str(), name));
675675
}
676676
LintSource::CommandLine(lint_flag_val) => {
677677
let flag = match level {
@@ -706,7 +706,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
706706
if lint_attr_name.as_str() != name {
707707
let level_str = level.as_str();
708708
sess.diag_note_once(&mut err, DiagnosticMessageId::from(lint),
709-
&format!("#[{}({})] implied by #[{}({})]",
709+
&format!("`#[{}({})]` implied by `#[{}({})]`",
710710
level_str, name, level_str, lint_attr_name));
711711
}
712712
}

src/test/run-pass/extern/extern-prelude-core.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: the feature `extern_prelude` has been stable since 1.30.0 and no longer
44
LL | #![feature(extern_prelude, lang_items, start)]
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(stable_features)] on by default
7+
= note: `#[warn(stable_features)]` on by default
88

src/test/run-pass/extern/extern-prelude-std.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: the feature `extern_prelude` has been stable since 1.30.0 and no longer
44
LL | #![feature(extern_prelude)]
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(stable_features)] on by default
7+
= note: `#[warn(stable_features)]` on by default
88

src/test/run-pass/if-ret.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: unreachable block in `if` expression
44
LL | fn foo() { if (return) { } }
55
| ^^^
66
|
7-
= note: #[warn(unreachable_code)] on by default
7+
= note: `#[warn(unreachable_code)]` on by default
88

src/test/run-pass/macros/macro-use-all-and-none.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: unused attribute
44
LL | #[macro_use()]
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(unused_attributes)] on by default
7+
= note: `#[warn(unused_attributes)]` on by default
88

src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-absolute.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: the feature `crate_in_paths` has been stable since 1.30.0 and no longer
44
LL | #![feature(crate_in_paths)]
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(stable_features)] on by default
7+
= note: `#[warn(stable_features)]` on by default
88

src/test/run-pass/rfcs/rfc-2126-crate-paths/crate-path-visibility-ambiguity.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: the feature `crate_in_paths` has been stable since 1.30.0 and no longer
44
LL | #![feature(crate_in_paths)]
55
| ^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(stable_features)] on by default
7+
= note: `#[warn(stable_features)]` on by default
88

src/test/rustdoc-ui/intra-links-warning-crlf.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `[error]` cannot be resolved, ignoring it...
44
LL | /// [error]
55
| ^^^^^ cannot be resolved, ignoring
66
|
7-
= note: #[warn(intra_doc_link_resolution_failure)] on by default
7+
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
88
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
99

1010
warning: `[error1]` cannot be resolved, ignoring it...

src/test/rustdoc-ui/intra-links-warning.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `[Foo::baz]` cannot be resolved, ignoring it...
44
LL | //! Test with [Foo::baz], [Bar::foo], ...
55
| ^^^^^^^^ cannot be resolved, ignoring
66
|
7-
= note: #[warn(intra_doc_link_resolution_failure)] on by default
7+
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
88
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
99

1010
warning: `[Bar::foo]` cannot be resolved, ignoring it...

src/test/rustdoc-ui/lint-group.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: lint level defined here
1313
|
1414
LL | #![deny(rustdoc)]
1515
| ^^^^^^^
16-
= note: #[deny(private_doc_tests)] implied by #[deny(rustdoc)]
16+
= note: `#[deny(private_doc_tests)]` implied by `#[deny(rustdoc)]`
1717

1818
error: `[error]` cannot be resolved, ignoring it...
1919
--> $DIR/lint-group.rs:9:29
@@ -26,7 +26,7 @@ note: lint level defined here
2626
|
2727
LL | #![deny(rustdoc)]
2828
| ^^^^^^^
29-
= note: #[deny(intra_doc_link_resolution_failure)] implied by #[deny(rustdoc)]
29+
= note: `#[deny(intra_doc_link_resolution_failure)]` implied by `#[deny(rustdoc)]`
3030
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
3131

3232
error: Missing code example in this documentation
@@ -40,7 +40,7 @@ note: lint level defined here
4040
|
4141
LL | #![deny(rustdoc)]
4242
| ^^^^^^^
43-
= note: #[deny(missing_doc_code_examples)] implied by #[deny(rustdoc)]
43+
= note: `#[deny(missing_doc_code_examples)]` implied by `#[deny(rustdoc)]`
4444

4545
error: aborting due to 3 previous errors
4646

src/test/ui-fulldeps/deprecated-derive.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: use of deprecated item 'Encodable': derive(Encodable) is deprecated in
44
LL | #[derive(Encodable)]
55
| ^^^^^^^^^
66
|
7-
= note: #[warn(deprecated)] on by default
7+
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-group-plugin.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ warning: item is named 'lintme'
44
LL | fn lintme() { }
55
| ^^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(test_lint)] on by default
7+
= note: `#[warn(test_lint)]` on by default
88

99
warning: item is named 'pleaselintme'
1010
--> $DIR/lint-group-plugin.rs:10:1
1111
|
1212
LL | fn pleaselintme() { }
1313
| ^^^^^^^^^^^^^^^^^^^^^
1414
|
15-
= note: #[warn(please_lint)] on by default
15+
= note: `#[warn(please_lint)]` on by default
1616

src/test/ui-fulldeps/lint-plugin-cmdline-allow.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ note: lint level defined here
99
|
1010
LL | #![warn(unused)]
1111
| ^^^^^^
12-
= note: #[warn(dead_code)] implied by #[warn(unused)]
12+
= note: `#[warn(dead_code)]` implied by `#[warn(unused)]`
1313

src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: item is named 'lintme'
44
LL | fn lintme() { }
55
| ^^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(test_lint)] on by default
7+
= note: `#[warn(test_lint)]` on by default
88

src/test/ui-fulldeps/lint-plugin.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: item is named 'lintme'
44
LL | fn lintme() { }
55
| ^^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(test_lint)] on by default
7+
= note: `#[warn(test_lint)]` on by default
88

src/test/ui-fulldeps/lint-tool-cmdline-allow.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ warning: item is named 'lintme'
88
LL | fn lintme() {}
99
| ^^^^^^^^^^^^^^
1010
|
11-
= note: #[warn(clippy::test_lint)] on by default
11+
= note: `#[warn(clippy::test_lint)]` on by default
1212

1313
warning: function is never used: `lintme`
1414
--> $DIR/lint-tool-cmdline-allow.rs:10:1
@@ -21,5 +21,5 @@ note: lint level defined here
2121
|
2222
LL | #![warn(unused)]
2323
| ^^^^^^
24-
= note: #[warn(dead_code)] implied by #[warn(unused)]
24+
= note: `#[warn(dead_code)]` implied by `#[warn(unused)]`
2525

src/test/ui-fulldeps/lint-tool-test.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: lint name `test_lint` is deprecated and may not have an effect in the f
44
LL | #![cfg_attr(foo, warn(test_lint))]
55
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
66
|
7-
= note: #[warn(renamed_and_removed_lints)] on by default
7+
= note: `#[warn(renamed_and_removed_lints)]` on by default
88

99
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
1010
--> $DIR/lint-tool-test.rs:11:9
@@ -24,7 +24,7 @@ warning: unknown lint: `this_lint_does_not_exist`
2424
LL | #[deny(this_lint_does_not_exist)]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^
2626
|
27-
= note: #[warn(unknown_lints)] on by default
27+
= note: `#[warn(unknown_lints)]` on by default
2828

2929
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
3030
--> $DIR/lint-tool-test.rs:8:23
@@ -43,7 +43,7 @@ note: lint level defined here
4343
|
4444
LL | #![deny(clippy_group)]
4545
| ^^^^^^^^^^^^
46-
= note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)]
46+
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`
4747

4848
error: item is named 'lintmetoo'
4949
--> $DIR/lint-tool-test.rs:22:5
@@ -56,7 +56,7 @@ note: lint level defined here
5656
|
5757
LL | #![deny(clippy_group)]
5858
| ^^^^^^^^^^^^
59-
= note: #[deny(clippy::test_group)] implied by #[deny(clippy::group)]
59+
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`
6060

6161
error: aborting due to 2 previous errors
6262

src/test/ui/array_const_index-0.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const B: i32 = (&A)[1];
66
| |
77
| index out of bounds: the len is 0 but the index is 1
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010

1111
error: aborting due to previous error
1212

src/test/ui/array_const_index-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const B: i32 = A[1];
66
| |
77
| index out of bounds: the len is 0 but the index is 1
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010

1111
error: aborting due to previous error
1212

src/test/ui/associated-type-bounds/type-alias.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: where clauses are not enforced in type aliases
44
LL | type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(type_alias_bounds)] on by default
7+
= note: `#[warn(type_alias_bounds)]` on by default
88
= help: the clause will not be checked when the type alias is used, and should be removed
99

1010
warning: where clauses are not enforced in type aliases

src/test/ui/bad/bad-lint-cap2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: lint level defined here
99
|
1010
LL | #![deny(warnings)]
1111
| ^^^^^^^^
12-
= note: #[deny(unused_imports)] implied by #[deny(warnings)]
12+
= note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`
1313

1414
error: aborting due to previous error
1515

src/test/ui/bad/bad-lint-cap3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ note: lint level defined here
99
|
1010
LL | #![deny(warnings)]
1111
| ^^^^^^^^
12-
= note: #[warn(unused_imports)] implied by #[warn(warnings)]
12+
= note: `#[warn(unused_imports)]` implied by `#[warn(warnings)]`
1313

src/test/ui/block-result/block-must-not-have-result-while.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: denote infinite loops with `loop { ... }`
44
LL | while true {
55
| ^^^^^^^^^^ help: use `loop`
66
|
7-
= note: #[warn(while_true)] on by default
7+
= note: `#[warn(while_true)]` on by default
88

99
error[E0308]: mismatched types
1010
--> $DIR/block-must-not-have-result-while.rs:3:9

src/test/ui/borrowck/mut-borrow-in-loop.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: denote infinite loops with `loop { ... }`
44
LL | while true {
55
| ^^^^^^^^^^ help: use `loop`
66
|
7-
= note: #[warn(while_true)] on by default
7+
= note: `#[warn(while_true)]` on by default
88

99
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
1010
--> $DIR/mut-borrow-in-loop.rs:10:25

src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LL | v.push(shared.len());
3131
| |
3232
| mutable borrow occurs here
3333
|
34-
= note: #[warn(mutable_borrow_reservation_conflict)] on by default
34+
= note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
3535
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
3636
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
3737

src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LL | v.push(shared.len());
3131
| |
3232
| mutable borrow occurs here
3333
|
34-
= note: #[warn(mutable_borrow_reservation_conflict)] on by default
34+
= note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
3535
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
3636
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
3737

src/test/ui/codemap_tests/unicode_3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: denote infinite loops with `loop { ... }`
44
LL | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
55
| ^^^^^^^^^^ help: use `loop`
66
|
7-
= note: #[warn(while_true)] on by default
7+
= note: `#[warn(while_true)]` on by default
88

src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: lint level defined here
99
|
1010
LL | #![deny(unused)]
1111
| ^^^^^^
12-
= note: #[deny(unused_attributes)] implied by #[deny(unused)]
12+
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`
1313

1414
error: unused attribute
1515
--> $DIR/cfg-attr-empty-is-unused.rs:10:1

src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: use of deprecated item 'MustUseDeprecated'
44
LL | impl MustUseDeprecated {
55
| ^^^^^^^^^^^^^^^^^
66
|
7-
= note: #[warn(deprecated)] on by default
7+
= note: `#[warn(deprecated)]` on by default
88

99
warning: use of deprecated item 'MustUseDeprecated'
1010
--> $DIR/cfg-attr-multi-true.rs:19:5

src/test/ui/consts/array-literal-index-oob.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: index out of bounds: the len is 3 but the index is 4
44
LL | &{[1, 2, 3][4]};
55
| ^^^^^^^^^^^^
66
|
7-
= note: #[deny(const_err)] on by default
7+
= note: `#[deny(const_err)]` on by default
88

99
error: this expression will panic at runtime
1010
--> $DIR/array-literal-index-oob.rs:2:5

src/test/ui/consts/const-eval/const-pointer-values-in-various-types.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_
1414
| |
1515
| a raw memory access tried to access part of a pointer value as raw bytes
1616
|
17-
= note: #[deny(const_err)] on by default
17+
= note: `#[deny(const_err)]` on by default
1818

1919
error: any use of this value will cause an error
2020
--> $DIR/const-pointer-values-in-various-types.rs:30:45

src/test/ui/consts/const-eval/const_panic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | pub const Z: () = panic!("cheese");
66
| |
77
| the evaluated program panicked at 'cheese', $DIR/const_panic.rs:4:19
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1111

1212
error: any use of this value will cause an error

src/test/ui/consts/const-eval/const_panic_libcore.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const Z: () = panic!("cheese");
66
| |
77
| the evaluated program panicked at 'cheese', $DIR/const_panic_libcore.rs:5:15
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1111

1212
error: any use of this value will cause an error

src/test/ui/consts/const-eval/const_panic_libcore_main.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const Z: () = panic!("cheese");
66
| |
77
| the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:9:15
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1111

1212
error: any use of this value will cause an error

src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 };
66
| |
77
| "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010

1111
error: any use of this value will cause an error
1212
--> $DIR/const_raw_ptr_ops.rs:12:28

src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: index out of bounds: the len is 1 but the index is 1
44
LL | array[1];
55
| ^^^^^^^^
66
|
7-
= note: #[deny(const_err)] on by default
7+
= note: `#[deny(const_err)]` on by default
88

99
error: aborting due to previous error
1010

src/test/ui/consts/const-eval/issue-49296.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const X: u64 = *wat(42);
66
| |
77
| dangling pointer was dereferenced
88
|
9-
= note: #[deny(const_err)] on by default
9+
= note: `#[deny(const_err)]` on by default
1010

1111
error: aborting due to previous error
1212

0 commit comments

Comments
 (0)