summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/non_expressive_names.rs
blob: 583096ac054a15dcc076570b91eb6991d84c258c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#![warn(clippy::all)]
#![allow(unused, clippy::println_empty_string, non_snake_case, clippy::let_unit_value)]

#[derive(Clone, Debug)]
enum MaybeInst {
    Split,
    Split1(usize),
    Split2(usize),
}

struct InstSplit {
    uiae: usize,
}

impl MaybeInst {
    fn fill(&mut self) {
        #[allow(non_fmt_panics)]
        let filled = match *self {
            MaybeInst::Split1(goto1) => panic!("1"),
            MaybeInst::Split2(goto2) => panic!("2"),
            _ => unimplemented!(),
        };
        unimplemented!()
    }
}

fn underscores_and_numbers() {
    let _1 = 1; //~ERROR Consider a more descriptive name
    let ____1 = 1; //~ERROR Consider a more descriptive name
    let __1___2 = 12; //~ERROR Consider a more descriptive name
    let _1_ok = 1;
}

fn issue2927() {
    let args = 1;
    format!("{:?}", 2);
}

fn issue3078() {
    #[allow(clippy::single_match)]
    match "a" {
        stringify!(a) => {},
        _ => {},
    }
}

struct Bar;

impl Bar {
    fn bar() {
        let _1 = 1;
        let ____1 = 1;
        let __1___2 = 12;
        let _1_ok = 1;
    }
}

fn main() {}