]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/non_expressive_names.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / non_expressive_names.rs
CommitLineData
f20569fa
XL
1#![warn(clippy::all)]
2#![allow(unused, clippy::println_empty_string)]
3
4#[derive(Clone, Debug)]
5enum MaybeInst {
6 Split,
7 Split1(usize),
8 Split2(usize),
9}
10
11struct InstSplit {
12 uiae: usize,
13}
14
15impl 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
26fn 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
33fn issue2927() {
34 let args = 1;
35 format!("{:?}", 2);
36}
37
38fn issue3078() {
39 match "a" {
40 stringify!(a) => {},
41 _ => {},
42 }
43}
44
45struct Bar;
46
47impl 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
56fn main() {}