]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/non_expressive_names.rs
bump version to 1.79.0+dfsg1-1~bpo12+pve2
[rustc.git] / src / tools / clippy / tests / ui / non_expressive_names.rs
1 #![warn(clippy::all)]
2 #![allow(unused, clippy::println_empty_string, non_snake_case, clippy::let_unit_value)]
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 #[allow(non_fmt_panics)]
18 let filled = match *self {
19 MaybeInst::Split1(goto1) => panic!("1"),
20 MaybeInst::Split2(goto2) => panic!("2"),
21 _ => unimplemented!(),
22 };
23 unimplemented!()
24 }
25 }
26
27 fn underscores_and_numbers() {
28 let _1 = 1; //~ERROR: consider choosing a more descriptive name
29 let ____1 = 1; //~ERROR: consider choosing a more descriptive name
30 let __1___2 = 12; //~ERROR: consider choosing a more descriptive name
31 let _1_ok = 1;
32 }
33
34 fn issue2927() {
35 let args = 1;
36 format!("{:?}", 2);
37 }
38
39 fn issue3078() {
40 #[allow(clippy::single_match)]
41 match "a" {
42 stringify!(a) => {},
43 _ => {},
44 }
45 }
46
47 struct Bar;
48
49 impl Bar {
50 fn bar() {
51 let _1 = 1; //~ERROR: consider choosing a more descriptive name
52 let ____1 = 1; //~ERROR: consider choosing a more descriptive name
53 let __1___2 = 12; //~ERROR: consider choosing a more descriptive name
54 let _1_ok = 1;
55 }
56 }
57
58 fn main() {}