]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/non_expressive_names.rs
Auto merge of #71751 - oli-obk:const_ice, r=RalfJung
[rust.git] / src / tools / clippy / tests / ui / non_expressive_names.rs
1 #![warn(clippy::all)]
2 #![allow(unused, clippy::println_empty_string)]
3
4 #[derive(Clone, Debug)]
5 enum MaybeInst {
6     Split,
7     Split1(usize),
8     Split2(usize),
9 }
10
11 struct InstSplit {
12     uiae: usize,
13 }
14
15 impl MaybeInst {
16     fn fill(&mut self) {
17         let filled = match *self {
18             MaybeInst::Split1(goto1) => panic!(1),
19             MaybeInst::Split2(goto2) => panic!(2),
20             _ => unimplemented!(),
21         };
22         unimplemented!()
23     }
24 }
25
26 fn underscores_and_numbers() {
27     let _1 = 1; //~ERROR Consider a more descriptive name
28     let ____1 = 1; //~ERROR Consider a more descriptive name
29     let __1___2 = 12; //~ERROR Consider a more descriptive name
30     let _1_ok = 1;
31 }
32
33 fn issue2927() {
34     let args = 1;
35     format!("{:?}", 2);
36 }
37
38 fn issue3078() {
39     match "a" {
40         stringify!(a) => {},
41         _ => {},
42     }
43 }
44
45 struct Bar;
46
47 impl Bar {
48     fn bar() {
49         let _1 = 1;
50         let ____1 = 1;
51         let __1___2 = 12;
52         let _1_ok = 1;
53     }
54 }
55
56 fn main() {}