1 #![allow(
2     dead_code,
3     clippy::similar_names,
4     clippy::single_match,
5     clippy::toplevel_ref_arg,
6     unused_mut,
7     unused_variables
8 )]
9 #![warn(clippy::blacklisted_name)]
10 
test(foo: ())11 fn test(foo: ()) {}
12 
main()13 fn main() {
14     let foo = 42;
15     let baz = 42;
16     let quux = 42;
17     // Unlike these others, `bar` is actually considered an acceptable name.
18     // Among many other legitimate uses, bar commonly refers to a period of time in music.
19     // See https://github.com/rust-lang/rust-clippy/issues/5225.
20     let bar = 42;
21 
22     let food = 42;
23     let foodstuffs = 42;
24     let bazaar = 42;
25 
26     match (42, Some(1337), Some(0)) {
27         (foo, Some(baz), quux @ Some(_)) => (),
28         _ => (),
29     }
30 }
31 
issue_1647(mut foo: u8)32 fn issue_1647(mut foo: u8) {
33     let mut baz = 0;
34     if let Some(mut quux) = Some(42) {}
35 }
36 
issue_1647_ref()37 fn issue_1647_ref() {
38     let ref baz = 0;
39     if let Some(ref quux) = Some(42) {}
40 }
41 
issue_1647_ref_mut()42 fn issue_1647_ref_mut() {
43     let ref mut baz = 0;
44     if let Some(ref mut quux) = Some(42) {}
45 }
46 
47 mod tests {
issue_7305()48     fn issue_7305() {
49         // `blackisted_name` lint should not be triggered inside of the test code.
50         let foo = 0;
51 
52         // Check that even in nested functions warning is still not triggere.
53         fn nested() {
54             let foo = 0;
55         }
56     }
57 }
58