about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIain Brandram-Adams <ijijnj@gmail.com>2020-06-14 01:24:36 +1200
committerIain Brandram-Adams <ijijnj@gmail.com>2020-06-14 01:24:36 +1200
commitf663a21c8f51db58ff73e2e0d9852d03e8916a5e (patch)
tree8dceb01e42dc0230d2489d417451f32eca80dce9
parent742706511c9f33c6a0d4380392e513e5249057e3 (diff)
downloadrust-f663a21c8f51db58ff73e2e0d9852d03e8916a5e.tar.gz
rust-f663a21c8f51db58ff73e2e0d9852d03e8916a5e.zip
Remove `bar` from blacklisted names
-rw-r--r--clippy_lints/src/utils/conf.rs2
-rw-r--r--tests/ui/blacklisted_name.rs23
2 files changed, 14 insertions, 11 deletions
diff --git a/clippy_lints/src/utils/conf.rs b/clippy_lints/src/utils/conf.rs
index 9e8e0ff30ec..418c4ded544 100644
--- a/clippy_lints/src/utils/conf.rs
+++ b/clippy_lints/src/utils/conf.rs
@@ -107,7 +107,7 @@ macro_rules! define_Conf {
 pub use self::helpers::Conf;
 define_Conf! {
     /// Lint: BLACKLISTED_NAME. The list of blacklisted names to lint about
-    (blacklisted_names, "blacklisted_names": Vec<String>, ["foo", "bar", "baz", "quux"].iter().map(ToString::to_string).collect()),
+    (blacklisted_names, "blacklisted_names": Vec<String>, ["foo", "baz", "quux"].iter().map(ToString::to_string).collect()),
     /// Lint: COGNITIVE_COMPLEXITY. The maximum cognitive complexity a function can have
     (cognitive_complexity_threshold, "cognitive_complexity_threshold": u64, 25),
     /// DEPRECATED LINT: CYCLOMATIC_COMPLEXITY. Use the Cognitive Complexity lint instead.
diff --git a/tests/ui/blacklisted_name.rs b/tests/ui/blacklisted_name.rs
index ca9d8d16b78..3d87eb06181 100644
--- a/tests/ui/blacklisted_name.rs
+++ b/tests/ui/blacklisted_name.rs
@@ -12,29 +12,32 @@ fn test(foo: ()) {}
 
 fn main() {
     let foo = 42;
-    let bar = 42;
     let baz = 42;
+    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 barb = 42;
-    let barbaric = 42;
+    let food = 42;
+    let foodstuffs = 42;
+    let bazaar = 42;
 
     match (42, Some(1337), Some(0)) {
-        (foo, Some(bar), baz @ Some(_)) => (),
+        (foo, Some(baz), quux @ Some(_)) => (),
         _ => (),
     }
 }
 
 fn issue_1647(mut foo: u8) {
-    let mut bar = 0;
-    if let Some(mut baz) = Some(42) {}
+    let mut baz = 0;
+    if let Some(mut quux) = Some(42) {}
 }
 
 fn issue_1647_ref() {
-    let ref bar = 0;
-    if let Some(ref baz) = Some(42) {}
+    let ref baz = 0;
+    if let Some(ref quux) = Some(42) {}
 }
 
 fn issue_1647_ref_mut() {
-    let ref mut bar = 0;
-    if let Some(ref mut baz) = Some(42) {}
+    let ref mut baz = 0;
+    if let Some(ref mut quux) = Some(42) {}
 }