about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-19 22:31:11 +0000
committerbors <bors@rust-lang.org>2023-11-19 22:31:11 +0000
commit41140e3cb8642abb12404520ac95c4ac82ead73f (patch)
treec65856fa1d9426a1c0b86bec87155af65ec2acf8 /tests
parent9c3a365fd2e2486d2b8efce99b0159821e2eca4f (diff)
parentdfbca7ffa8e0f7d69374f5f6dd351cc34ed0e811 (diff)
downloadrust-41140e3cb8642abb12404520ac95c4ac82ead73f.tar.gz
rust-41140e3cb8642abb12404520ac95c4ac82ead73f.zip
Auto merge of #11840 - GuillaumeGomez:improve-maybe_misused_cfg, r=blyxyas
Improve maybe misused cfg

Follow-up of the improvements that were suggested to me in https://github.com/rust-lang/rust-clippy/pull/11821:

 * I unified the output to use the same terms.
 * I updated the code to prevent creating a new symbol.

r? `@blyxyas`

changelog: [`maybe_misued_cfg`]: Output and code improvements
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/cfg_features.fixed8
-rw-r--r--tests/ui/cfg_features.rs8
-rw-r--r--tests/ui/cfg_features.stderr24
3 files changed, 20 insertions, 20 deletions
diff --git a/tests/ui/cfg_features.fixed b/tests/ui/cfg_features.fixed
index 2a02132a740..0fe38f169f9 100644
--- a/tests/ui/cfg_features.fixed
+++ b/tests/ui/cfg_features.fixed
@@ -2,17 +2,17 @@
 
 fn main() {
     #[cfg(feature = "not-really-a-feature")]
-    //~^ ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
     //~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
     let _ = 1 + 2;
 
     #[cfg(all(feature = "right", feature = "wrong"))]
-    //~^ ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
     let _ = 1 + 2;
 
     #[cfg(all(feature = "wrong1", any(feature = "right", feature = "wrong2", feature, features)))]
-    //~^ ERROR: feature may misspelled as features
-    //~| ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
+    //~| ERROR: 'feature' may be misspelled as 'features'
     let _ = 1 + 2;
 
     #[cfg(test)]
diff --git a/tests/ui/cfg_features.rs b/tests/ui/cfg_features.rs
index efe2fb04922..9c0db035eac 100644
--- a/tests/ui/cfg_features.rs
+++ b/tests/ui/cfg_features.rs
@@ -2,17 +2,17 @@
 
 fn main() {
     #[cfg(features = "not-really-a-feature")]
-    //~^ ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
     //~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
     let _ = 1 + 2;
 
     #[cfg(all(feature = "right", features = "wrong"))]
-    //~^ ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
     let _ = 1 + 2;
 
     #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
-    //~^ ERROR: feature may misspelled as features
-    //~| ERROR: feature may misspelled as features
+    //~^ ERROR: 'feature' may be misspelled as 'features'
+    //~| ERROR: 'feature' may be misspelled as 'features'
     let _ = 1 + 2;
 
     #[cfg(tests)]
diff --git a/tests/ui/cfg_features.stderr b/tests/ui/cfg_features.stderr
index 441de5b41f4..e1593e2071b 100644
--- a/tests/ui/cfg_features.stderr
+++ b/tests/ui/cfg_features.stderr
@@ -1,53 +1,53 @@
-error: feature may misspelled as features
+error: 'feature' may be misspelled as 'features'
   --> $DIR/cfg_features.rs:4:11
    |
 LL |     #[cfg(features = "not-really-a-feature")]
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `feature = "not-really-a-feature"`
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "not-really-a-feature"`
    |
    = note: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::maybe_misused_cfg)]`
 
-error: feature may misspelled as features
+error: 'feature' may be misspelled as 'features'
   --> $DIR/cfg_features.rs:9:34
    |
 LL |     #[cfg(all(feature = "right", features = "wrong"))]
-   |                                  ^^^^^^^^^^^^^^^^^^ help: use: `feature = "wrong"`
+   |                                  ^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong"`
 
-error: feature may misspelled as features
+error: 'feature' may be misspelled as 'features'
   --> $DIR/cfg_features.rs:13:15
    |
 LL |     #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
-   |               ^^^^^^^^^^^^^^^^^^^ help: use: `feature = "wrong1"`
+   |               ^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong1"`
 
-error: feature may misspelled as features
+error: 'feature' may be misspelled as 'features'
   --> $DIR/cfg_features.rs:13:59
    |
 LL |     #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
-   |                                                           ^^^^^^^^^^^^^^^^^^^ help: use: `feature = "wrong2"`
+   |                                                           ^^^^^^^^^^^^^^^^^^^ help: did you mean: `feature = "wrong2"`
 
 error: 'test' may be misspelled as 'tests'
   --> $DIR/cfg_features.rs:18:11
    |
 LL |     #[cfg(tests)]
-   |           ^^^^^ help: do you mean: `test`
+   |           ^^^^^ help: did you mean: `test`
 
 error: 'test' may be misspelled as 'Test'
   --> $DIR/cfg_features.rs:21:11
    |
 LL |     #[cfg(Test)]
-   |           ^^^^ help: do you mean: `test`
+   |           ^^^^ help: did you mean: `test`
 
 error: 'test' may be misspelled as 'tests'
   --> $DIR/cfg_features.rs:25:15
    |
 LL |     #[cfg(all(tests, Test))]
-   |               ^^^^^ help: do you mean: `test`
+   |               ^^^^^ help: did you mean: `test`
 
 error: 'test' may be misspelled as 'Test'
   --> $DIR/cfg_features.rs:25:22
    |
 LL |     #[cfg(all(tests, Test))]
-   |                      ^^^^ help: do you mean: `test`
+   |                      ^^^^ help: did you mean: `test`
 
 error: aborting due to 8 previous errors