let (lvl, src) =
self.sets
.get_lint_level(lint, self.cur, Some(&specs), &sess);
+ let msg = format!(
+ "lint name `{}` is deprecated \
+ and may not have an effect in the future \
+ Also `cfg_attr(cargo-clippy)` won't be necessary anymore",
+ name
+ );
let mut err = lint::struct_lint_level(
self.sess,
lint,
lvl,
src,
Some(li.span.into()),
- &format!(
- "lint name `{}` is deprecated \
- and may not have an effect in the future",
- name
- ),
+ &msg,
);
err.span_suggestion_with_applicability(
li.span,
"change it to",
new_lint_name.to_string(),
Applicability::MachineApplicable,
- );
- err.emit();
+ ).emit();
+
let src = LintSource::Node(Symbol::intern(&new_lint_name), li.span);
for id in ids {
specs.insert(*id, (level, src));
-warning: lint name `clippy_group` is deprecated and may not have an effect in the future
+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:17:9
|
LL | #![deny(clippy_group)]
|
= note: #[warn(renamed_and_removed_lints)] on by default
-warning: lint name `test_group` is deprecated and may not have an effect in the future
- --> $DIR/lint_tool_test.rs:31:9
+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
+ --> $DIR/lint_tool_test.rs:32:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: unknown lint: `this_lint_does_not_exist`
- --> $DIR/lint_tool_test.rs:33:8
+ --> $DIR/lint_tool_test.rs:34:8
|
LL | #[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unknown_lints)] on by default
-warning: lint name `clippy_group` is deprecated and may not have an effect in the future
+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:17:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
error: item is named 'lintme'
- --> $DIR/lint_tool_test.rs:20:1
+ --> $DIR/lint_tool_test.rs:21:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
| ^^^^^^^^^^^^^^^
= note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)]
error: item is named 'lintmetoo'
- --> $DIR/lint_tool_test.rs:28:5
+ --> $DIR/lint_tool_test.rs:29:5
|
LL | fn lintmetoo() { } //~ ERROR item is named 'lintmetoo'
| ^^^^^^^^^^^^^^^^^^