Skip to content

Commit f663a21

Browse files
author
Iain Brandram-Adams
committed
Remove bar from blacklisted names
1 parent 7427065 commit f663a21

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

clippy_lints/src/utils/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ macro_rules! define_Conf {
107107
pub use self::helpers::Conf;
108108
define_Conf! {
109109
/// Lint: BLACKLISTED_NAME. The list of blacklisted names to lint about
110-
(blacklisted_names, "blacklisted_names": Vec<String>, ["foo", "bar", "baz", "quux"].iter().map(ToString::to_string).collect()),
110+
(blacklisted_names, "blacklisted_names": Vec<String>, ["foo", "baz", "quux"].iter().map(ToString::to_string).collect()),
111111
/// Lint: COGNITIVE_COMPLEXITY. The maximum cognitive complexity a function can have
112112
(cognitive_complexity_threshold, "cognitive_complexity_threshold": u64, 25),
113113
/// DEPRECATED LINT: CYCLOMATIC_COMPLEXITY. Use the Cognitive Complexity lint instead.

tests/ui/blacklisted_name.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,32 @@ fn test(foo: ()) {}
1212

1313
fn main() {
1414
let foo = 42;
15-
let bar = 42;
1615
let baz = 42;
16+
let quux = 42;
17+
// Unlike these others, `bar` is considered an acceptable name to use.
18+
// See https://github.com/rust-lang/rust-clippy/issues/5225.
1719

18-
let barb = 42;
19-
let barbaric = 42;
20+
let food = 42;
21+
let foodstuffs = 42;
22+
let bazaar = 42;
2023

2124
match (42, Some(1337), Some(0)) {
22-
(foo, Some(bar), baz @ Some(_)) => (),
25+
(foo, Some(baz), quux @ Some(_)) => (),
2326
_ => (),
2427
}
2528
}
2629

2730
fn issue_1647(mut foo: u8) {
28-
let mut bar = 0;
29-
if let Some(mut baz) = Some(42) {}
31+
let mut baz = 0;
32+
if let Some(mut quux) = Some(42) {}
3033
}
3134

3235
fn issue_1647_ref() {
33-
let ref bar = 0;
34-
if let Some(ref baz) = Some(42) {}
36+
let ref baz = 0;
37+
if let Some(ref quux) = Some(42) {}
3538
}
3639

3740
fn issue_1647_ref_mut() {
38-
let ref mut bar = 0;
39-
if let Some(ref mut baz) = Some(42) {}
41+
let ref mut baz = 0;
42+
if let Some(ref mut quux) = Some(42) {}
4043
}

0 commit comments

Comments
 (0)