]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_field_names.rs
Merge branch 'master' into suspicious_impl
[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     name: u8,
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     let name: u8 = 0;
21
22     let me = Person {
23         gender: gender,
24         age: age,
25
26         name, //should be ok
27         buzz: fizz, //should be ok
28         foo: foo::BAR, //should be ok
29     };
30 }