Skip to content

Commit 25f39fe

Browse files
committed
Auto merge of #81135 - jyn514:no-backticks, r=flip1995
Fix formatting for removed lints - Don't add backticks for the reason a lint was removed. This is almost never a code block, and when it is the backticks should be in the reason itself. - Don't assume clippy is the only tool that needs to be checked for backwards compatibility I split this out of #80527 because it kept causing tests to fail, and it's a good change to have anyway. r? `@flip1995`
2 parents dc1eee2 + 77b5ced commit 25f39fe

File tree

8 files changed

+41
-42
lines changed

8 files changed

+41
-42
lines changed

compiler/rustc_lint/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl LintStore {
387387
Some(new_name.to_owned()),
388388
),
389389
Some(&Removed(ref reason)) => CheckLintNameResult::Warning(
390-
format!("lint `{}` has been removed: `{}`", complete_name, reason),
390+
format!("lint `{}` has been removed: {}", complete_name, reason),
391391
None,
392392
),
393393
None => match self.lint_groups.get(&*complete_name) {

compiler/rustc_lint/src/levels.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ impl<'s> LintLevelsBuilder<'s> {
311311
|lint| {
312312
let msg = format!(
313313
"lint name `{}` is deprecated \
314-
and may not have an effect in the future. \
315-
Also `cfg_attr(cargo-clippy)` won't be necessary anymore",
314+
and may not have an effect in the future.",
316315
name
317316
);
318317
lint.build(&msg)

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
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
1+
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
22
--> $DIR/lint-tool-test.rs:9:23
33
|
44
LL | #![cfg_attr(foo, warn(test_lint))]
55
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
66
|
77
= note: `#[warn(renamed_and_removed_lints)]` on by default
88

9-
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
9+
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
1010
--> $DIR/lint-tool-test.rs:13:9
1111
|
1212
LL | #![deny(clippy_group)]
1313
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
1414

15-
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
15+
warning: lint name `test_group` is deprecated and may not have an effect in the future.
1616
--> $DIR/lint-tool-test.rs:29:9
1717
|
1818
LL | #[allow(test_group)]
@@ -26,19 +26,19 @@ LL | #[deny(this_lint_does_not_exist)]
2626
|
2727
= note: `#[warn(unknown_lints)]` on by default
2828

29-
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
29+
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
3030
--> $DIR/lint-tool-test.rs:9:23
3131
|
3232
LL | #![cfg_attr(foo, warn(test_lint))]
3333
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
3434

35-
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
35+
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
3636
--> $DIR/lint-tool-test.rs:13:9
3737
|
3838
LL | #![deny(clippy_group)]
3939
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
4040

41-
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
41+
warning: lint name `test_group` is deprecated and may not have an effect in the future.
4242
--> $DIR/lint-tool-test.rs:29:9
4343
|
4444
LL | #[allow(test_group)]
@@ -52,13 +52,13 @@ LL | #![plugin(lint_tool_test)]
5252
|
5353
= note: `#[warn(deprecated)]` on by default
5454

55-
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
55+
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
5656
--> $DIR/lint-tool-test.rs:9:23
5757
|
5858
LL | #![cfg_attr(foo, warn(test_lint))]
5959
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
6060

61-
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
61+
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
6262
--> $DIR/lint-tool-test.rs:13:9
6363
|
6464
LL | #![deny(clippy_group)]
@@ -90,7 +90,7 @@ LL | #![deny(clippy_group)]
9090
| ^^^^^^^^^^^^
9191
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`
9292

93-
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
93+
warning: lint name `test_group` is deprecated and may not have an effect in the future.
9494
--> $DIR/lint-tool-test.rs:29:9
9595
|
9696
LL | #[allow(test_group)]

src/test/ui/lint/lint-removed-cmdline.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok`
1+
warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
22
|
33
= note: requested on the command line with `-D raw_pointer_derive`
44

5-
warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok`
5+
warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
66
|
77
= note: requested on the command line with `-D raw_pointer_derive`
88

9-
warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok`
9+
warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
1010
|
1111
= note: requested on the command line with `-D raw_pointer_derive`
1212

13-
warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok`
13+
warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
1414
|
1515
= note: requested on the command line with `-D raw_pointer_derive`
1616

src/test/ui/lint/lint-removed.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok`
1+
warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
22
--> $DIR/lint-removed.rs:6:8
33
|
44
LL | #[deny(raw_pointer_derive)]

src/test/ui/lint/lint-unexported-no-mangle.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, `#[no_mangle]` functions always exported`
1+
warning: lint `private_no_mangle_fns` has been removed: no longer a warning, `#[no_mangle]` functions always exported
22
|
33
= note: requested on the command line with `-F private_no_mangle_fns`
44

5-
warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, `#[no_mangle]` statics always exported`
5+
warning: lint `private_no_mangle_statics` has been removed: no longer a warning, `#[no_mangle]` statics always exported
66
|
77
= note: requested on the command line with `-F private_no_mangle_statics`
88

9-
warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, `#[no_mangle]` functions always exported`
9+
warning: lint `private_no_mangle_fns` has been removed: no longer a warning, `#[no_mangle]` functions always exported
1010
|
1111
= note: requested on the command line with `-F private_no_mangle_fns`
1212

13-
warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, `#[no_mangle]` statics always exported`
13+
warning: lint `private_no_mangle_statics` has been removed: no longer a warning, `#[no_mangle]` statics always exported
1414
|
1515
= note: requested on the command line with `-F private_no_mangle_statics`
1616

17-
warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, `#[no_mangle]` functions always exported`
17+
warning: lint `private_no_mangle_fns` has been removed: no longer a warning, `#[no_mangle]` functions always exported
1818
|
1919
= note: requested on the command line with `-F private_no_mangle_fns`
2020

21-
warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, `#[no_mangle]` statics always exported`
21+
warning: lint `private_no_mangle_statics` has been removed: no longer a warning, `#[no_mangle]` statics always exported
2222
|
2323
= note: requested on the command line with `-F private_no_mangle_statics`
2424

25-
warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, `#[no_mangle]` functions always exported`
25+
warning: lint `private_no_mangle_fns` has been removed: no longer a warning, `#[no_mangle]` functions always exported
2626
|
2727
= note: requested on the command line with `-F private_no_mangle_fns`
2828

29-
warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, `#[no_mangle]` statics always exported`
29+
warning: lint `private_no_mangle_statics` has been removed: no longer a warning, `#[no_mangle]` statics always exported
3030
|
3131
= note: requested on the command line with `-F private_no_mangle_statics`
3232

src/tools/clippy/tests/ui/deprecated.stderr

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
error: lint `clippy::unstable_as_slice` has been removed: ``Vec::as_slice` has been stabilized in 1.7`
1+
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
22
--> $DIR/deprecated.rs:1:8
33
|
44
LL | #[warn(clippy::unstable_as_slice)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
88

9-
error: lint `clippy::unstable_as_mut_slice` has been removed: ``Vec::as_mut_slice` has been stabilized in 1.7`
9+
error: lint `clippy::unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` has been stabilized in 1.7
1010
--> $DIR/deprecated.rs:2:8
1111
|
1212
LL | #[warn(clippy::unstable_as_mut_slice)]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

15-
error: lint `clippy::misaligned_transmute` has been removed: `this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr`
15+
error: lint `clippy::misaligned_transmute` has been removed: this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr
1616
--> $DIR/deprecated.rs:3:8
1717
|
1818
LL | #[warn(clippy::misaligned_transmute)]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

21-
error: lint `clippy::unused_collect` has been removed: ``collect` has been marked as #[must_use] in rustc and that covers all cases of this lint`
21+
error: lint `clippy::unused_collect` has been removed: `collect` has been marked as #[must_use] in rustc and that covers all cases of this lint
2222
--> $DIR/deprecated.rs:4:8
2323
|
2424
LL | #[warn(clippy::unused_collect)]
2525
| ^^^^^^^^^^^^^^^^^^^^^^
2626

27-
error: lint `clippy::invalid_ref` has been removed: `superseded by rustc lint `invalid_value``
27+
error: lint `clippy::invalid_ref` has been removed: superseded by rustc lint `invalid_value`
2828
--> $DIR/deprecated.rs:5:8
2929
|
3030
LL | #[warn(clippy::invalid_ref)]
3131
| ^^^^^^^^^^^^^^^^^^^
3232

33-
error: lint `clippy::into_iter_on_array` has been removed: `this lint has been uplifted to rustc and is now called `array_into_iter``
33+
error: lint `clippy::into_iter_on_array` has been removed: this lint has been uplifted to rustc and is now called `array_into_iter`
3434
--> $DIR/deprecated.rs:6:8
3535
|
3636
LL | #[warn(clippy::into_iter_on_array)]
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
3838

39-
error: lint `clippy::unused_label` has been removed: `this lint has been uplifted to rustc and is now called `unused_labels``
39+
error: lint `clippy::unused_label` has been removed: this lint has been uplifted to rustc and is now called `unused_labels`
4040
--> $DIR/deprecated.rs:7:8
4141
|
4242
LL | #[warn(clippy::unused_label)]
4343
| ^^^^^^^^^^^^^^^^^^^^
4444

45-
error: lint `clippy::regex_macro` has been removed: `the regex! macro has been removed from the regex crate in 2018`
45+
error: lint `clippy::regex_macro` has been removed: the regex! macro has been removed from the regex crate in 2018
4646
--> $DIR/deprecated.rs:8:8
4747
|
4848
LL | #[warn(clippy::regex_macro)]
4949
| ^^^^^^^^^^^^^^^^^^^
5050

51-
error: lint `clippy::drop_bounds` has been removed: `this lint has been uplifted to rustc and is now called `drop_bounds``
51+
error: lint `clippy::drop_bounds` has been removed: this lint has been uplifted to rustc and is now called `drop_bounds`
5252
--> $DIR/deprecated.rs:9:8
5353
|
5454
LL | #[warn(clippy::drop_bounds)]
5555
| ^^^^^^^^^^^^^^^^^^^
5656

57-
error: lint `clippy::temporary_cstring_as_ptr` has been removed: `this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr``
57+
error: lint `clippy::temporary_cstring_as_ptr` has been removed: this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`
5858
--> $DIR/deprecated.rs:10:8
5959
|
6060
LL | #[warn(clippy::temporary_cstring_as_ptr)]
6161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6262

63-
error: lint `clippy::panic_params` has been removed: `this lint has been uplifted to rustc and is now called `panic_fmt``
63+
error: lint `clippy::panic_params` has been removed: this lint has been uplifted to rustc and is now called `panic_fmt`
6464
--> $DIR/deprecated.rs:11:8
6565
|
6666
LL | #[warn(clippy::panic_params)]
6767
| ^^^^^^^^^^^^^^^^^^^^
6868

69-
error: lint `clippy::unknown_clippy_lints` has been removed: `this lint has been integrated into the `unknown_lints` rustc lint`
69+
error: lint `clippy::unknown_clippy_lints` has been removed: this lint has been integrated into the `unknown_lints` rustc lint
7070
--> $DIR/deprecated.rs:12:8
7171
|
7272
LL | #[warn(clippy::unknown_clippy_lints)]
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7474

75-
error: lint `clippy::unstable_as_slice` has been removed: ``Vec::as_slice` has been stabilized in 1.7`
75+
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
7676
--> $DIR/deprecated.rs:1:8
7777
|
7878
LL | #[warn(clippy::unstable_as_slice)]

src/tools/clippy/tests/ui/deprecated_old.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error: lint `unstable_as_slice` has been removed: ``Vec::as_slice` has been stabilized in 1.7`
1+
error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
22
--> $DIR/deprecated_old.rs:1:8
33
|
44
LL | #[warn(unstable_as_slice)]
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
88

9-
error: lint `unstable_as_mut_slice` has been removed: ``Vec::as_mut_slice` has been stabilized in 1.7`
9+
error: lint `unstable_as_mut_slice` has been removed: `Vec::as_mut_slice` has been stabilized in 1.7
1010
--> $DIR/deprecated_old.rs:2:8
1111
|
1212
LL | #[warn(unstable_as_mut_slice)]
1313
| ^^^^^^^^^^^^^^^^^^^^^
1414

15-
error: lint `misaligned_transmute` has been removed: `this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr`
15+
error: lint `misaligned_transmute` has been removed: this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr
1616
--> $DIR/deprecated_old.rs:3:8
1717
|
1818
LL | #[warn(misaligned_transmute)]
1919
| ^^^^^^^^^^^^^^^^^^^^
2020

21-
error: lint `unstable_as_slice` has been removed: ``Vec::as_slice` has been stabilized in 1.7`
21+
error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
2222
--> $DIR/deprecated_old.rs:1:8
2323
|
2424
LL | #[warn(unstable_as_slice)]

0 commit comments

Comments
 (0)