From 27daef980d7e8924d1c6834db5cebec9e847d93e Mon Sep 17 00:00:00 2001 From: flip1995 <9744647+flip1995@users.noreply.github.com> Date: Wed, 19 Sep 2018 15:39:02 +0200 Subject: [PATCH 1/2] Cancel warning for tool_lints --- src/librustc/lint/levels.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/lint/levels.rs b/src/librustc/lint/levels.rs index 336ebe79d33ab..e430aec8d0f5b 100644 --- a/src/librustc/lint/levels.rs +++ b/src/librustc/lint/levels.rs @@ -299,7 +299,7 @@ impl<'a> LintLevelsBuilder<'a> { "change it to", new_lint_name.to_string(), Applicability::MachineApplicable, - ).emit(); + ).cancel(); let src = LintSource::Node(Symbol::intern(&new_lint_name), li.span); for id in ids { From 4e5eba50a3545fc22b047418e4dafe8abc7750a4 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 1 Oct 2018 10:38:51 +0200 Subject: [PATCH 2/2] Remove lint_tool tests --- src/test/ui-fulldeps/lint_tool_test.rs | 40 -------------- src/test/ui-fulldeps/lint_tool_test.stderr | 62 ---------------------- 2 files changed, 102 deletions(-) delete mode 100644 src/test/ui-fulldeps/lint_tool_test.rs delete mode 100644 src/test/ui-fulldeps/lint_tool_test.stderr diff --git a/src/test/ui-fulldeps/lint_tool_test.rs b/src/test/ui-fulldeps/lint_tool_test.rs deleted file mode 100644 index ebe10b3714f20..0000000000000 --- a/src/test/ui-fulldeps/lint_tool_test.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:lint_tool_test.rs -// ignore-stage1 -// compile-flags: --cfg foo -#![feature(plugin)] -#![feature(tool_lints)] -#![plugin(lint_tool_test)] -#![allow(dead_code)] -#![cfg_attr(foo, warn(test_lint))] -//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future -//~^^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future -#![deny(clippy_group)] -//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future - -fn lintme() { } //~ ERROR item is named 'lintme' - -#[allow(clippy::group)] -fn lintmetoo() {} - -#[allow(clippy::test_lint)] -pub fn main() { - fn lintme() { } - fn lintmetoo() { } //~ ERROR item is named 'lintmetoo' -} - -#[allow(test_group)] -//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future -#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist` -fn hello() { - fn lintmetoo() { } -} diff --git a/src/test/ui-fulldeps/lint_tool_test.stderr b/src/test/ui-fulldeps/lint_tool_test.stderr deleted file mode 100644 index ab0c317e1cd0f..0000000000000 --- a/src/test/ui-fulldeps/lint_tool_test.stderr +++ /dev/null @@ -1,62 +0,0 @@ -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:18:23 - | -LL | #![cfg_attr(foo, warn(test_lint))] - | ^^^^^^^^^ help: change it to: `clippy::test_lint` - | - = 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:21:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` - -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:35: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:37: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 `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:18:23 - | -LL | #![cfg_attr(foo, warn(test_lint))] - | ^^^^^^^^^ help: change it to: `clippy::test_lint` - -error: item is named 'lintme' - --> $DIR/lint_tool_test.rs:24:1 - | -LL | fn lintme() { } //~ ERROR item is named 'lintme' - | ^^^^^^^^^^^^^^^ - | -note: lint level defined here - --> $DIR/lint_tool_test.rs:21:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ - = note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)] - -error: item is named 'lintmetoo' - --> $DIR/lint_tool_test.rs:32:5 - | -LL | fn lintmetoo() { } //~ ERROR item is named 'lintmetoo' - | ^^^^^^^^^^^^^^^^^^ - | -note: lint level defined here - --> $DIR/lint_tool_test.rs:21:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ - = note: #[deny(clippy::test_group)] implied by #[deny(clippy::group)] - -error: aborting due to 2 previous errors -