Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bar from blacklisted names #5712

Merged
merged 3 commits into from
Jun 23, 2020
Merged

Remove bar from blacklisted names #5712

merged 3 commits into from
Jun 23, 2020

Conversation

ijijn
Copy link
Contributor

@ijijn ijijn commented Jun 13, 2020

changelog: Remove bar from blacklisted names
fixes #5225

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthiaskrgr (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 13, 2020
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, don't worry about the CI failure, this will be fixed with #5711

You have to update the stderr file. You can do this with sh tests/ui/update-all-references.sh after running cargo uitest.

tests/ui/blacklisted_name.rs Show resolved Hide resolved
@flip1995
Copy link
Member

r? @flip1995

@flip1995
Copy link
Member

Or you can just apply this patch:

diff --git a/tests/ui/blacklisted_name.rs b/tests/ui/blacklisted_name.rs
index 3d87eb061..093195efc 100644
--- a/tests/ui/blacklisted_name.rs
+++ b/tests/ui/blacklisted_name.rs
@@ -16,6 +16,7 @@ fn main() {
     let quux = 42;
     // Unlike these others, `bar` is considered an acceptable name to use.
     // See https://github.com/rust-lang/rust-clippy/issues/5225.
+    let bar = 42;
 
     let food = 42;
     let foodstuffs = 42;
diff --git a/tests/ui/blacklisted_name.stderr b/tests/ui/blacklisted_name.stderr
index 44123829f..3ff5d2760 100644
--- a/tests/ui/blacklisted_name.stderr
+++ b/tests/ui/blacklisted_name.stderr
@@ -12,77 +12,77 @@ error: use of a blacklisted/placeholder name `foo`
 LL |     let foo = 42;
    |         ^^^
 
-error: use of a blacklisted/placeholder name `bar`
+error: use of a blacklisted/placeholder name `baz`
   --> $DIR/blacklisted_name.rs:15:9
    |
-LL |     let bar = 42;
+LL |     let baz = 42;
    |         ^^^
 
-error: use of a blacklisted/placeholder name `baz`
+error: use of a blacklisted/placeholder name `quux`
   --> $DIR/blacklisted_name.rs:16:9
    |
-LL |     let baz = 42;
-   |         ^^^
+LL |     let quux = 42;
+   |         ^^^^
 
 error: use of a blacklisted/placeholder name `foo`
-  --> $DIR/blacklisted_name.rs:22:10
+  --> $DIR/blacklisted_name.rs:26:10
    |
-LL |         (foo, Some(bar), baz @ Some(_)) => (),
+LL |         (foo, Some(baz), quux @ Some(_)) => (),
    |          ^^^
 
-error: use of a blacklisted/placeholder name `bar`
-  --> $DIR/blacklisted_name.rs:22:20
+error: use of a blacklisted/placeholder name `baz`
+  --> $DIR/blacklisted_name.rs:26:20
    |
-LL |         (foo, Some(bar), baz @ Some(_)) => (),
+LL |         (foo, Some(baz), quux @ Some(_)) => (),
    |                    ^^^
 
-error: use of a blacklisted/placeholder name `baz`
-  --> $DIR/blacklisted_name.rs:22:26
+error: use of a blacklisted/placeholder name `quux`
+  --> $DIR/blacklisted_name.rs:26:26
    |
-LL |         (foo, Some(bar), baz @ Some(_)) => (),
-   |                          ^^^
+LL |         (foo, Some(baz), quux @ Some(_)) => (),
+   |                          ^^^^
 
 error: use of a blacklisted/placeholder name `foo`
-  --> $DIR/blacklisted_name.rs:27:19
+  --> $DIR/blacklisted_name.rs:31:19
    |
 LL | fn issue_1647(mut foo: u8) {
    |                   ^^^
 
-error: use of a blacklisted/placeholder name `bar`
-  --> $DIR/blacklisted_name.rs:28:13
+error: use of a blacklisted/placeholder name `baz`
+  --> $DIR/blacklisted_name.rs:32:13
    |
-LL |     let mut bar = 0;
+LL |     let mut baz = 0;
    |             ^^^
 
-error: use of a blacklisted/placeholder name `baz`
-  --> $DIR/blacklisted_name.rs:29:21
+error: use of a blacklisted/placeholder name `quux`
+  --> $DIR/blacklisted_name.rs:33:21
    |
-LL |     if let Some(mut baz) = Some(42) {}
-   |                     ^^^
+LL |     if let Some(mut quux) = Some(42) {}
+   |                     ^^^^
 
-error: use of a blacklisted/placeholder name `bar`
-  --> $DIR/blacklisted_name.rs:33:13
+error: use of a blacklisted/placeholder name `baz`
+  --> $DIR/blacklisted_name.rs:37:13
    |
-LL |     let ref bar = 0;
+LL |     let ref baz = 0;
    |             ^^^
 
-error: use of a blacklisted/placeholder name `baz`
-  --> $DIR/blacklisted_name.rs:34:21
+error: use of a blacklisted/placeholder name `quux`
+  --> $DIR/blacklisted_name.rs:38:21
    |
-LL |     if let Some(ref baz) = Some(42) {}
-   |                     ^^^
+LL |     if let Some(ref quux) = Some(42) {}
+   |                     ^^^^
 
-error: use of a blacklisted/placeholder name `bar`
-  --> $DIR/blacklisted_name.rs:38:17
+error: use of a blacklisted/placeholder name `baz`
+  --> $DIR/blacklisted_name.rs:42:17
    |
-LL |     let ref mut bar = 0;
+LL |     let ref mut baz = 0;
    |                 ^^^
 
-error: use of a blacklisted/placeholder name `baz`
-  --> $DIR/blacklisted_name.rs:39:25
+error: use of a blacklisted/placeholder name `quux`
+  --> $DIR/blacklisted_name.rs:43:25
    |
-LL |     if let Some(ref mut baz) = Some(42) {}
-   |                         ^^^
+LL |     if let Some(ref mut quux) = Some(42) {}
+   |                         ^^^^
 
 error: aborting due to 14 previous errors

@@ -107,7 +107,7 @@ macro_rules! define_Conf {
pub use self::helpers::Conf;
define_Conf! {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would explain in the documentation why "bar" isn't in that list, as it's a well-known list and I wouldn't be surprised if someone raised the issue or opened a PR to readd it "because we forgot about it".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll try reinforcing the situation in the comments. Thanks!

@flip1995 flip1995 added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jun 15, 2020
@flip1995
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 23, 2020

📌 Commit 454ed47 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Jun 23, 2020

🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened

bors added a commit that referenced this pull request Jun 23, 2020
Rollup of 9 pull requests

Successful merges:

 - #5178 (clippy-driver: pass all args to rustc if --rustc is present)
 - #5705 (Downgrade unnested_or_patterns to pedantic)
 - #5709 (Fix ICE in consts::binop)
 - #5710 (typo)
 - #5712 (Remove `bar` from blacklisted names)
 - #5713 (Use lints in Clippy that are enabled in rustc bootstrap)
 - #5716 (Fix typo in wildcard_imports)
 - #5724 (redundant_pattern_matching: avoid non-`const fn` calls in const contexts)
 - #5726 (Fix typo)

Failed merges:

r? @ghost

changelog: rollup
@bors bors merged commit 0799be7 into rust-lang:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

false positive on blacklisted_name (bar)
6 participants