make lint on-by-default/implied-by messages appear only once

From review discussion on #38103
(https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
This commit is contained in:
Zack M. Davis 2017-06-26 13:30:21 -07:00
parent 859c3236e5
commit 32b8579b68
5 changed files with 63 additions and 41 deletions

View file

@ -4,12 +4,12 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
14 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[deny(non_snake_case)] implied by #[deny(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:11:9
|
11 | #![deny(bad_style)]
| ^^^^^^^^^
= note: #[deny(non_snake_case)] implied by #[deny(bad_style)]
error: function `CamelCase` should have a snake case name such as `camel_case`
--> $DIR/lint-group-style.rs:22:9
@ -17,12 +17,12 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
22 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[forbid(non_snake_case)] implied by #[forbid(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
20 | #[forbid(bad_style)]
| ^^^^^^^^^
= note: #[forbid(non_snake_case)] implied by #[forbid(bad_style)]
error: static variable `bad` should have an upper case name such as `BAD`
--> $DIR/lint-group-style.rs:24:9
@ -30,12 +30,12 @@ error: static variable `bad` should have an upper case name such as `BAD`
24 | static bad: isize = 1;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[forbid(non_upper_case_globals)] implied by #[forbid(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
20 | #[forbid(bad_style)]
| ^^^^^^^^^
= note: #[forbid(non_upper_case_globals)] implied by #[forbid(bad_style)]
warning: function `CamelCase` should have a snake case name such as `camel_case`
--> $DIR/lint-group-style.rs:30:9
@ -43,12 +43,12 @@ warning: function `CamelCase` should have a snake case name such as `camel_case`
30 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[warn(non_snake_case)] implied by #[warn(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
28 | #![warn(bad_style)]
| ^^^^^^^^^
= note: #[warn(non_snake_case)] implied by #[warn(bad_style)]
warning: type `snake_case` should have a camel case name such as `SnakeCase`
--> $DIR/lint-group-style.rs:32:9
@ -56,12 +56,12 @@ warning: type `snake_case` should have a camel case name such as `SnakeCase`
32 | struct snake_case;
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(non_camel_case_types)] implied by #[warn(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
28 | #![warn(bad_style)]
| ^^^^^^^^^
= note: #[warn(non_camel_case_types)] implied by #[warn(bad_style)]
error: aborting due to previous error(s)

View file

@ -23,6 +23,4 @@ warning: function is never used: `no_parens`
20 | | return <T as ToString>::to_string(&arg);
21 | | }
| |_^
|
= note: #[warn(dead_code)] on by default

View file

@ -4,20 +4,18 @@ error: variable `theTwo` should have a snake case name such as `the_two`
19 | let theTwo = 2;
| ^^^^^^
|
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
note: lint level defined here
--> $DIR/issue-24690.rs:16:9
|
16 | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
error: variable `theOtherTwo` should have a snake case name such as `the_other_two`
--> $DIR/issue-24690.rs:20:9
|
20 | let theOtherTwo = 2;
| ^^^^^^^^^^^
|
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
error: unused variable: `theOtherTwo`
--> $DIR/issue-24690.rs:20:9
@ -25,12 +23,12 @@ error: unused variable: `theOtherTwo`
20 | let theOtherTwo = 2;
| ^^^^^^^^^^^
|
= note: #[deny(unused_variables)] implied by #[deny(warnings)]
note: lint level defined here
--> $DIR/issue-24690.rs:16:9
|
16 | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(unused_variables)] implied by #[deny(warnings)]
error: aborting due to previous error(s)