]> git.lizzy.rs Git - rust.git/blob - tests/ui/non_expressive_names.rs
Merge pull request #1520 from Manishearth/rustup
[rust.git] / tests / ui / non_expressive_names.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3 #![deny(clippy,similar_names)]
4
5
6
7
8
9
10
11
12
13
14
15 #![allow(unused)]
16
17
18 struct Foo {
19     apple: i32,
20     bpple: i32,
21 }
22
23 fn main() {
24     let specter: i32;
25     let spectre: i32;
26
27     let apple: i32;
28
29     let bpple: i32;
30
31     let cpple: i32;
32
33
34     let a_bar: i32;
35     let b_bar: i32;
36     let c_bar: i32;
37
38     let items = [5];
39     for item in &items {
40         loop {}
41     }
42
43     let foo_x: i32;
44     let foo_y: i32;
45
46     let rhs: i32;
47     let lhs: i32;
48
49     let bla_rhs: i32;
50     let bla_lhs: i32;
51
52     let blubrhs: i32;
53     let blublhs: i32;
54
55     let blubx: i32;
56     let bluby: i32;
57
58
59     let cake: i32;
60     let cakes: i32;
61     let coke: i32;
62
63     match 5 {
64         cheese @ 1 => {},
65         rabbit => panic!(),
66     }
67     let cheese: i32;
68     match (42, 43) {
69         (cheese1, 1) => {},
70         (cheese2, 2) => panic!(),
71         _ => println!(""),
72     }
73     let ipv4: i32;
74     let ipv6: i32;
75     let abcd1: i32;
76     let abdc2: i32;
77     let xyz1abc: i32;
78     let xyz2abc: i32;
79     let xyzeabc: i32;
80
81     let parser: i32;
82     let parsed: i32;
83     let parsee: i32;
84
85
86     let setter: i32;
87     let getter: i32;
88     let tx1: i32;
89     let rx1: i32;
90     let tx_cake: i32;
91     let rx_cake: i32;
92 }
93
94 fn foo() {
95     let Foo { apple, bpple } = unimplemented!();
96     let Foo { apple: spring,
97         bpple: sprang } = unimplemented!();
98 }
99
100 #[derive(Clone, Debug)]
101 enum MaybeInst {
102     Split,
103     Split1(usize),
104     Split2(usize),
105 }
106
107 struct InstSplit {
108     uiae: usize,
109 }
110
111 impl MaybeInst {
112     fn fill(&mut self) {
113         let filled = match *self {
114             MaybeInst::Split1(goto1) => panic!(1),
115             MaybeInst::Split2(goto2) => panic!(2),
116             _ => unimplemented!(),
117         };
118         unimplemented!()
119     }
120 }
121
122 fn bla() {
123     let a: i32;
124     let (b, c, d): (i32, i64, i16);
125     {
126         {
127             let cdefg: i32;
128             let blar: i32;
129         }
130         {
131             let e: i32;
132
133         }
134         {
135             let e: i32;
136
137             let f: i32;
138
139         }
140         match 5 {
141             1 => println!(""),
142             e => panic!(),
143
144         }
145         match 5 {
146             1 => println!(""),
147             _ => panic!(),
148         }
149     }
150 }