Skip to content

Commit 72af42e

Browse files
committed
note wording: lint implied by lint group, not lint group implies lint
1 parent 778958f commit 72af42e

7 files changed

+16
-16
lines changed

src/librustc/lint/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -483,16 +483,16 @@ pub fn raw_struct_lint<'a, S>(sess: &'a Session,
483483
flag, hyphen_case_lint_name));
484484
} else {
485485
let hyphen_case_flag_val = lint_flag_val.as_str().replace("_", "-");
486-
err.note(&format!("`{} {}` implies `{} {}`",
487-
flag, hyphen_case_flag_val, flag, hyphen_case_lint_name));
486+
err.note(&format!("`{} {}` implied by `{} {}`",
487+
flag, hyphen_case_lint_name, flag, hyphen_case_flag_val));
488488
}
489489
},
490490
Node(lint_attr_name, src) => {
491491
def = Some(src);
492492
if lint_attr_name.as_str().deref() != name {
493493
let level_str = level.as_str();
494-
err.note(&format!("#[{}({})] implies #[{}({})]",
495-
level_str, lint_attr_name, level_str, name));
494+
err.note(&format!("#[{}({})] implied by #[{}({})]",
495+
level_str, name, level_str, lint_attr_name));
496496
}
497497
}
498498
}

src/test/compile-fail/issue-30730.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
#![deny(warnings)] //~ NOTE: lint level defined here
1212
use std::thread;
1313
//~^ ERROR: unused import
14-
//~| NOTE: #[deny(warnings)] implies #[deny(unused_imports)]
14+
//~| NOTE: #[deny(unused_imports)] implied by #[deny(warnings)]
1515
fn main() {}

src/test/ui/lint/command-line-lint-group-deny.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: variable `_InappropriateCamelCasing` should have a snake case name such a
44
14 | let _InappropriateCamelCasing = true;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D bad-style` implies `-D non-snake-case`
7+
= note: `-D non-snake-case` implied by `-D bad-style`
88

99
error: aborting due to previous error
1010

src/test/ui/lint/command-line-lint-group-forbid.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: variable `_InappropriateCamelCasing` should have a snake case name such a
44
14 | let _InappropriateCamelCasing = true;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-F bad-style` implies `-F non-snake-case`
7+
= note: `-F non-snake-case` implied by `-F bad-style`
88

99
error: aborting due to previous error
1010

src/test/ui/lint/command-line-lint-group-warn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: variable `_InappropriateCamelCasing` should have a snake case name such
44
14 | let _InappropriateCamelCasing = true;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-W bad-style` implies `-W non-snake-case`
7+
= note: `-W non-snake-case` implied by `-W bad-style`
88

src/test/ui/lint/lint-group-style.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
44
14 | fn CamelCase() {}
55
| ^^^^^^^^^^^^^^^^^
66
|
7-
= note: #[deny(bad_style)] implies #[deny(non_snake_case)]
7+
= note: #[deny(non_snake_case)] implied by #[deny(bad_style)]
88
note: lint level defined here
99
--> $DIR/lint-group-style.rs:11:9
1010
|
@@ -17,7 +17,7 @@ error: function `CamelCase` should have a snake case name such as `camel_case`
1717
22 | fn CamelCase() {}
1818
| ^^^^^^^^^^^^^^^^^
1919
|
20-
= note: #[forbid(bad_style)] implies #[forbid(non_snake_case)]
20+
= note: #[forbid(non_snake_case)] implied by #[forbid(bad_style)]
2121
note: lint level defined here
2222
--> $DIR/lint-group-style.rs:20:14
2323
|
@@ -30,7 +30,7 @@ error: static variable `bad` should have an upper case name such as `BAD`
3030
24 | static bad: isize = 1;
3131
| ^^^^^^^^^^^^^^^^^^^^^^
3232
|
33-
= note: #[forbid(bad_style)] implies #[forbid(non_upper_case_globals)]
33+
= note: #[forbid(non_upper_case_globals)] implied by #[forbid(bad_style)]
3434
note: lint level defined here
3535
--> $DIR/lint-group-style.rs:20:14
3636
|
@@ -43,7 +43,7 @@ warning: function `CamelCase` should have a snake case name such as `camel_case`
4343
30 | fn CamelCase() {}
4444
| ^^^^^^^^^^^^^^^^^
4545
|
46-
= note: #[warn(bad_style)] implies #[warn(non_snake_case)]
46+
= note: #[warn(non_snake_case)] implied by #[warn(bad_style)]
4747
note: lint level defined here
4848
--> $DIR/lint-group-style.rs:28:17
4949
|
@@ -56,7 +56,7 @@ warning: type `snake_case` should have a camel case name such as `SnakeCase`
5656
32 | struct snake_case;
5757
| ^^^^^^^^^^^^^^^^^^
5858
|
59-
= note: #[warn(bad_style)] implies #[warn(non_camel_case_types)]
59+
= note: #[warn(non_camel_case_types)] implied by #[warn(bad_style)]
6060
note: lint level defined here
6161
--> $DIR/lint-group-style.rs:28:17
6262
|

src/test/ui/span/issue-24690.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: variable `theTwo` should have a snake case name such as `the_two`
44
19 | let theTwo = 2;
55
| ^^^^^^
66
|
7-
= note: #[deny(warnings)] implies #[deny(non_snake_case)]
7+
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
88
note: lint level defined here
99
--> $DIR/issue-24690.rs:16:9
1010
|
@@ -17,15 +17,15 @@ error: variable `theOtherTwo` should have a snake case name such as `the_other_t
1717
20 | let theOtherTwo = 2;
1818
| ^^^^^^^^^^^
1919
|
20-
= note: #[deny(warnings)] implies #[deny(non_snake_case)]
20+
= note: #[deny(non_snake_case)] implied by #[deny(warnings)]
2121

2222
error: unused variable: `theOtherTwo`
2323
--> $DIR/issue-24690.rs:20:9
2424
|
2525
20 | let theOtherTwo = 2;
2626
| ^^^^^^^^^^^
2727
|
28-
= note: #[deny(warnings)] implies #[deny(unused_variables)]
28+
= note: #[deny(unused_variables)] implied by #[deny(warnings)]
2929
note: lint level defined here
3030
--> $DIR/issue-24690.rs:16:9
3131
|

0 commit comments

Comments
 (0)