Skip to content

Commit 348b4ba

Browse files
Improve suggestion for maybe_misued_cfg lint
1 parent 68ecd9e commit 348b4ba

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

clippy_lints/src/attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ fn check_nested_misused_cfg(cx: &EarlyContext<'_>, items: &[NestedMetaItem]) {
938938
MAYBE_MISUSED_CFG,
939939
meta.span,
940940
"'feature' may be misspelled as 'features'",
941-
"do you mean",
941+
"did you mean",
942942
format!("feature = \"{val}\""),
943943
Applicability::MaybeIncorrect,
944944
);
@@ -954,7 +954,7 @@ fn check_nested_misused_cfg(cx: &EarlyContext<'_>, items: &[NestedMetaItem]) {
954954
MAYBE_MISUSED_CFG,
955955
meta.span,
956956
&format!("'test' may be misspelled as '{}'", ident.name.as_str()),
957-
"do you mean",
957+
"did you mean",
958958
"test".to_string(),
959959
Applicability::MaybeIncorrect,
960960
);

tests/ui/cfg_features.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: 'feature' may be misspelled as 'features'
22
--> $DIR/cfg_features.rs:4:11
33
|
44
LL | #[cfg(features = "not-really-a-feature")]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: do you mean: `feature = "not-really-a-feature"`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "not-really-a-feature"`
66
|
77
= note: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::maybe_misused_cfg)]`
@@ -11,43 +11,43 @@ error: 'feature' may be misspelled as 'features'
1111
--> $DIR/cfg_features.rs:9:34
1212
|
1313
LL | #[cfg(all(feature = "right", features = "wrong"))]
14-
| ^^^^^^^^^^^^^^^^^^ help: do you mean: `feature = "wrong"`
14+
| ^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong"`
1515

1616
error: 'feature' may be misspelled as 'features'
1717
--> $DIR/cfg_features.rs:13:15
1818
|
1919
LL | #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
20-
| ^^^^^^^^^^^^^^^^^^^ help: do you mean: `feature = "wrong1"`
20+
| ^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong1"`
2121

2222
error: 'feature' may be misspelled as 'features'
2323
--> $DIR/cfg_features.rs:13:59
2424
|
2525
LL | #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
26-
| ^^^^^^^^^^^^^^^^^^^ help: do you mean: `feature = "wrong2"`
26+
| ^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong2"`
2727

2828
error: 'test' may be misspelled as 'tests'
2929
--> $DIR/cfg_features.rs:18:11
3030
|
3131
LL | #[cfg(tests)]
32-
| ^^^^^ help: do you mean: `test`
32+
| ^^^^^ help: did you mean: `test`
3333

3434
error: 'test' may be misspelled as 'Test'
3535
--> $DIR/cfg_features.rs:21:11
3636
|
3737
LL | #[cfg(Test)]
38-
| ^^^^ help: do you mean: `test`
38+
| ^^^^ help: did you mean: `test`
3939

4040
error: 'test' may be misspelled as 'tests'
4141
--> $DIR/cfg_features.rs:25:15
4242
|
4343
LL | #[cfg(all(tests, Test))]
44-
| ^^^^^ help: do you mean: `test`
44+
| ^^^^^ help: did you mean: `test`
4545

4646
error: 'test' may be misspelled as 'Test'
4747
--> $DIR/cfg_features.rs:25:22
4848
|
4949
LL | #[cfg(all(tests, Test))]
50-
| ^^^^ help: do you mean: `test`
50+
| ^^^^ help: did you mean: `test`
5151

5252
error: aborting due to 8 previous errors
5353

0 commit comments

Comments
 (0)