Skip to content

Commit

Permalink
note wording: lint implied by lint group, not lint group implies lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zackmdavis committed Feb 4, 2017
1 parent 778958f commit 72af42e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/librustc/lint/context.rs
Expand Up @@ -483,16 +483,16 @@ pub fn raw_struct_lint<'a, S>(sess: &'a Session,
flag, hyphen_case_lint_name));
} else {
let hyphen_case_flag_val = lint_flag_val.as_str().replace("_", "-");
err.note(&format!("`{} {}` implies `{} {}`",
flag, hyphen_case_flag_val, flag, hyphen_case_lint_name));
err.note(&format!("`{} {}` implied by `{} {}`",
flag, hyphen_case_lint_name, flag, hyphen_case_flag_val));
}
},
Node(lint_attr_name, src) => {
def = Some(src);
if lint_attr_name.as_str().deref() != name {
let level_str = level.as_str();
err.note(&format!("#[{}({})] implies #[{}({})]",
level_str, lint_attr_name, level_str, name));
err.note(&format!("#[{}({})] implied by #[{}({})]",
level_str, name, level_str, lint_attr_name));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-30730.rs
Expand Up @@ -11,5 +11,5 @@
#![deny(warnings)] //~ NOTE: lint level defined here
use std::thread;
//~^ ERROR: unused import
//~| NOTE: #[deny(warnings)] implies #[deny(unused_imports)]
//~| NOTE: #[deny(unused_imports)] implied by #[deny(warnings)]
fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/lint/command-line-lint-group-deny.stderr
Expand Up @@ -4,7 +4,7 @@ error: variable `_InappropriateCamelCasing` should have a snake case name such a
14 | let _InappropriateCamelCasing = true;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D bad-style` implies `-D non-snake-case`
= note: `-D non-snake-case` implied by `-D bad-style`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/lint/command-line-lint-group-forbid.stderr
Expand Up @@ -4,7 +4,7 @@ error: variable `_InappropriateCamelCasing` should have a snake case name such a
14 | let _InappropriateCamelCasing = true;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-F bad-style` implies `-F non-snake-case`
= note: `-F non-snake-case` implied by `-F bad-style`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/lint/command-line-lint-group-warn.stderr
Expand Up @@ -4,5 +4,5 @@ warning: variable `_InappropriateCamelCasing` should have a snake case name such
14 | let _InappropriateCamelCasing = true;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-W bad-style` implies `-W non-snake-case`
= note: `-W non-snake-case` implied by `-W bad-style`

10 changes: 5 additions & 5 deletions src/test/ui/lint/lint-group-style.stderr
Expand Up @@ -4,7 +4,7 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
14 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[deny(bad_style)] implies #[deny(non_snake_case)]
= note: #[deny(non_snake_case)] implied by #[deny(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:11:9
|
Expand All @@ -17,7 +17,7 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
22 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[forbid(bad_style)] implies #[forbid(non_snake_case)]
= note: #[forbid(non_snake_case)] implied by #[forbid(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
Expand All @@ -30,7 +30,7 @@ error: static variable `bad` should have an upper case name such as `BAD`
24 | static bad: isize = 1;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[forbid(bad_style)] implies #[forbid(non_upper_case_globals)]
= note: #[forbid(non_upper_case_globals)] implied by #[forbid(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
Expand All @@ -43,7 +43,7 @@ warning: function `CamelCase` should have a snake case name such as `camel_case`
30 | fn CamelCase() {}
| ^^^^^^^^^^^^^^^^^
|
= note: #[warn(bad_style)] implies #[warn(non_snake_case)]
= note: #[warn(non_snake_case)] implied by #[warn(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
Expand All @@ -56,7 +56,7 @@ warning: type `snake_case` should have a camel case name such as `SnakeCase`
32 | struct snake_case;
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(bad_style)] implies #[warn(non_camel_case_types)]
= note: #[warn(non_camel_case_types)] implied by #[warn(bad_style)]
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/span/issue-24690.stderr
Expand Up @@ -4,7 +4,7 @@ error: variable `theTwo` should have a snake case name such as `the_two`
19 | let theTwo = 2;
| ^^^^^^
|
= note: #[deny(warnings)] implies #[deny(non_snake_case)]
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
note: lint level defined here
--> $DIR/issue-24690.rs:16:9
|
Expand All @@ -17,15 +17,15 @@ error: variable `theOtherTwo` should have a snake case name such as `the_other_t
20 | let theOtherTwo = 2;
| ^^^^^^^^^^^
|
= note: #[deny(warnings)] implies #[deny(non_snake_case)]
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]

error: unused variable: `theOtherTwo`
--> $DIR/issue-24690.rs:20:9
|
20 | let theOtherTwo = 2;
| ^^^^^^^^^^^
|
= note: #[deny(warnings)] implies #[deny(unused_variables)]
= note: #[deny(unused_variables)] implied by #[deny(warnings)]
note: lint level defined here
--> $DIR/issue-24690.rs:16:9
|
Expand Down

0 comments on commit 72af42e

Please sign in to comment.