Skip to content

Commit

Permalink
normalize use of backticks in compiler messages for librustc/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy Kacimi committed Jul 17, 2019
1 parent 96234d5 commit e5e1397
Show file tree
Hide file tree
Showing 149 changed files with 177 additions and 177 deletions.
6 changes: 3 additions & 3 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ declare_lint! {
declare_lint! {
pub UNUSED_FEATURES,
Warn,
"unused features found in crate-level #[feature] directives"
"unused features found in crate-level `#[feature]` directives"
}

declare_lint! {
pub STABLE_FEATURES,
Warn,
"stable features found in #[feature] directive"
"stable features found in `#[feature]` directive"
}

declare_lint! {
pub UNKNOWN_CRATE_TYPES,
Deny,
"unknown crate type found in #[crate_type] directive"
"unknown crate type found in `#[crate_type]` directive"
}

declare_lint! {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
sess.diag_note_once(
&mut err,
DiagnosticMessageId::from(lint),
&format!("#[{}({})] on by default", level.as_str(), name));
&format!("`#[{}({})]` on by default", level.as_str(), name));
}
LintSource::CommandLine(lint_flag_val) => {
let flag = match level {
Expand Down Expand Up @@ -706,7 +706,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
if lint_attr_name.as_str() != name {
let level_str = level.as_str();
sess.diag_note_once(&mut err, DiagnosticMessageId::from(lint),
&format!("#[{}({})] implied by #[{}({})]",
&format!("`#[{}({})]` implied by `#[{}({})]`",
level_str, name, level_str, lint_attr_name));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern/extern-prelude-core.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: the feature `extern_prelude` has been stable since 1.30.0 and no longer
LL | #![feature(extern_prelude, lang_items, start)]
| ^^^^^^^^^^^^^^
|
= note: #[warn(stable_features)] on by default
= note: `#[warn(stable_features)]` on by default

2 changes: 1 addition & 1 deletion src/test/run-pass/extern/extern-prelude-std.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: the feature `extern_prelude` has been stable since 1.30.0 and no longer
LL | #![feature(extern_prelude)]
| ^^^^^^^^^^^^^^
|
= note: #[warn(stable_features)] on by default
= note: `#[warn(stable_features)]` on by default

2 changes: 1 addition & 1 deletion src/test/run-pass/if-ret.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: unreachable block in `if` expression
LL | fn foo() { if (return) { } }
| ^^^
|
= note: #[warn(unreachable_code)] on by default
= note: `#[warn(unreachable_code)]` on by default

2 changes: 1 addition & 1 deletion src/test/run-pass/macros/macro-use-all-and-none.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: unused attribute
LL | #[macro_use()]
| ^^^^^^^^^^^^^^
|
= note: #[warn(unused_attributes)] on by default
= note: `#[warn(unused_attributes)]` on by default

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: the feature `crate_in_paths` has been stable since 1.30.0 and no longer
LL | #![feature(crate_in_paths)]
| ^^^^^^^^^^^^^^
|
= note: #[warn(stable_features)] on by default
= note: `#[warn(stable_features)]` on by default

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: the feature `crate_in_paths` has been stable since 1.30.0 and no longer
LL | #![feature(crate_in_paths)]
| ^^^^^^^^^^^^^^
|
= note: #[warn(stable_features)] on by default
= note: `#[warn(stable_features)]` on by default

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/intra-links-warning-crlf.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: `[error]` cannot be resolved, ignoring it...
LL | /// [error]
| ^^^^^ cannot be resolved, ignoring
|
= note: #[warn(intra_doc_link_resolution_failure)] on by default
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error1]` cannot be resolved, ignoring it...
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/intra-links-warning.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: `[Foo::baz]` cannot be resolved, ignoring it...
LL | //! Test with [Foo::baz], [Bar::foo], ...
| ^^^^^^^^ cannot be resolved, ignoring
|
= note: #[warn(intra_doc_link_resolution_failure)] on by default
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Bar::foo]` cannot be resolved, ignoring it...
Expand Down
6 changes: 3 additions & 3 deletions src/test/rustdoc-ui/lint-group.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ note: lint level defined here
|
LL | #![deny(rustdoc)]
| ^^^^^^^
= note: #[deny(private_doc_tests)] implied by #[deny(rustdoc)]
= note: `#[deny(private_doc_tests)]` implied by `#[deny(rustdoc)]`

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

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

error: aborting due to 3 previous errors

2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/deprecated-derive.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: use of deprecated item 'Encodable': derive(Encodable) is deprecated in
LL | #[derive(Encodable)]
| ^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
= note: `#[warn(deprecated)]` on by default

4 changes: 2 additions & 2 deletions src/test/ui-fulldeps/lint-group-plugin.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ warning: item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
= note: `#[warn(test_lint)]` on by default

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

2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/lint-plugin-cmdline-allow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ note: lint level defined here
|
LL | #![warn(unused)]
| ^^^^^^
= note: #[warn(dead_code)] implied by #[warn(unused)]
= note: `#[warn(dead_code)]` implied by `#[warn(unused)]`

2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
= note: `#[warn(test_lint)]` on by default

2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/lint-plugin.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
= note: `#[warn(test_lint)]` on by default

4 changes: 2 additions & 2 deletions src/test/ui-fulldeps/lint-tool-cmdline-allow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ warning: item is named 'lintme'
LL | fn lintme() {}
| ^^^^^^^^^^^^^^
|
= note: #[warn(clippy::test_lint)] on by default
= note: `#[warn(clippy::test_lint)]` on by default

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

8 changes: 4 additions & 4 deletions src/test/ui-fulldeps/lint-tool-test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: lint name `test_lint` is deprecated and may not have an effect in the f
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
|
= note: #[warn(renamed_and_removed_lints)] on by default
= note: `#[warn(renamed_and_removed_lints)]` on by default

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
--> $DIR/lint-tool-test.rs:11:9
Expand All @@ -24,7 +24,7 @@ warning: unknown lint: `this_lint_does_not_exist`
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unknown_lints)] on by default
= note: `#[warn(unknown_lints)]` on by default

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
--> $DIR/lint-tool-test.rs:8:23
Expand All @@ -43,7 +43,7 @@ note: lint level defined here
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)]
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`

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

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion src/test/ui/array_const_index-0.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const B: i32 = (&A)[1];
| |
| index out of bounds: the len is 0 but the index is 1
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/array_const_index-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const B: i32 = A[1];
| |
| index out of bounds: the len is 0 but the index is 1
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/type-alias.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: where clauses are not enforced in type aliases
LL | type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(type_alias_bounds)] on by default
= note: `#[warn(type_alias_bounds)]` on by default
= help: the clause will not be checked when the type alias is used, and should be removed

warning: where clauses are not enforced in type aliases
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-lint-cap2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: lint level defined here
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(unused_imports)] implied by #[deny(warnings)]
= note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/bad/bad-lint-cap3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ note: lint level defined here
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: #[warn(unused_imports)] implied by #[warn(warnings)]
= note: `#[warn(unused_imports)]` implied by `#[warn(warnings)]`

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

error[E0308]: mismatched types
--> $DIR/block-must-not-have-result-while.rs:3:9
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/borrowck/mut-borrow-in-loop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: denote infinite loops with `loop { ... }`
LL | while true {
| ^^^^^^^^^^ help: use `loop`
|
= note: #[warn(while_true)] on by default
= note: `#[warn(while_true)]` on by default

error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:10:25
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LL | v.push(shared.len());
| |
| mutable borrow occurs here
|
= note: #[warn(mutable_borrow_reservation_conflict)] on by default
= note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>

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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/unicode_3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ warning: denote infinite loops with `loop { ... }`
LL | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
| ^^^^^^^^^^ help: use `loop`
|
= note: #[warn(while_true)] on by default
= note: `#[warn(while_true)]` on by default

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: lint level defined here
|
LL | #![deny(unused)]
| ^^^^^^
= note: #[deny(unused_attributes)] implied by #[deny(unused)]
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`

error: unused attribute
--> $DIR/cfg-attr-empty-is-unused.rs:10:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: use of deprecated item 'MustUseDeprecated'
LL | impl MustUseDeprecated {
| ^^^^^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
= note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'MustUseDeprecated'
--> $DIR/cfg-attr-multi-true.rs:19:5
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/array-literal-index-oob.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: index out of bounds: the len is 3 but the index is 4
LL | &{[1, 2, 3][4]};
| ^^^^^^^^^^^^
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: this expression will panic at runtime
--> $DIR/array-literal-index-oob.rs:2:5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_
| |
| a raw memory access tried to access part of a pointer value as raw bytes
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:30:45
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/const_panic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | pub const Z: () = panic!("cheese");
| |
| the evaluated program panicked at 'cheese', $DIR/const_panic.rs:4:19
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: any use of this value will cause an error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/const_panic_libcore.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const Z: () = panic!("cheese");
| |
| the evaluated program panicked at 'cheese', $DIR/const_panic_libcore.rs:5:15
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: any use of this value will cause an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const Z: () = panic!("cheese");
| |
| the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:9:15
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: any use of this value will cause an error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 };
| |
| "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:12:28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: index out of bounds: the len is 1 but the index is 1
LL | array[1];
| ^^^^^^^^
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/issue-49296.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | const X: u64 = *wat(42);
| |
| dangling pointer was dereferenced
|
= note: #[deny(const_err)] on by default
= note: `#[deny(const_err)]` on by default

error: aborting due to previous error

Loading

0 comments on commit e5e1397

Please sign in to comment.