]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_field_names.rs
Implement redundant field names lint #2244
[rust.git] / tests / ui / redundant_field_names.rs
1 #![warn(redundant_field_names)]
2 #![allow(unused_variables)]
3
4 mod foo {
5     pub const BAR: u8 = 0;
6 }
7
8 struct Person {
9     gender: u8,
10     age: u8,
11
12     buzz: u64,
13     foo: u8,
14 }
15
16 fn main() {
17     let gender: u8 = 42;
18     let age = 0;
19     let fizz: u64 = 0;
20
21     let me = Person {
22         gender: gender,
23         age: age,
24
25         buzz: fizz, //should be ok
26         foo: foo::BAR, //should be ok
27     };
28 }