From b7765797285303ac6ba3317fe81a51412aeb59e4 Mon Sep 17 00:00:00 2001 From: flip1995 <9744647+flip1995@users.noreply.github.com> Date: Thu, 30 Aug 2018 10:27:35 +0200 Subject: [PATCH] Update tests --- .../auxiliary/lint_group_plugin_test.rs | 2 +- src/test/ui-fulldeps/lint_tool_test.rs | 5 ++- src/test/ui-fulldeps/lint_tool_test.stderr | 36 +++++++++++-------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs index 8ccb5878c40..082f15a39dd 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs @@ -49,5 +49,5 @@ fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { reg.register_late_lint_pass(box Pass); - reg.register_lint_group("lint_me", vec![TEST_LINT, PLEASE_LINT]); + reg.register_lint_group("lint_me", None, vec![TEST_LINT, PLEASE_LINT]); } diff --git a/src/test/ui-fulldeps/lint_tool_test.rs b/src/test/ui-fulldeps/lint_tool_test.rs index aef15c1abb1..ebe10b3714f 100644 --- a/src/test/ui-fulldeps/lint_tool_test.rs +++ b/src/test/ui-fulldeps/lint_tool_test.rs @@ -10,13 +10,16 @@ // 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 -//~^^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future fn lintme() { } //~ ERROR item is named 'lintme' diff --git a/src/test/ui-fulldeps/lint_tool_test.stderr b/src/test/ui-fulldeps/lint_tool_test.stderr index f2ee954264b..ab0c317e1cd 100644 --- a/src/test/ui-fulldeps/lint_tool_test.stderr +++ b/src/test/ui-fulldeps/lint_tool_test.stderr @@ -1,52 +1,58 @@ -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 +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 | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` +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 `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 +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:34:8 + --> $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 `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 +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 | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` +LL | #![cfg_attr(foo, warn(test_lint))] + | ^^^^^^^^^ help: change it to: `clippy::test_lint` error: item is named 'lintme' - --> $DIR/lint_tool_test.rs:21:1 + --> $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:17:9 + --> $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:29:5 + --> $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:17:9 + --> $DIR/lint_tool_test.rs:21:9 | LL | #![deny(clippy_group)] | ^^^^^^^^^^^^ -- 2.44.0