]>
Commit | Line | Data |
---|---|---|
c34b1796 AL |
1 | // aux-build:struct_field_privacy.rs |
2 | ||
3 | extern crate struct_field_privacy as xc; | |
4 | ||
5 | use xc::B; | |
6 | ||
7 | struct A { | |
8 | pub a: u32, | |
9 | b: u32, | |
10 | } | |
11 | ||
12 | fn main () { | |
13 | // external crate struct | |
14 | let k = B { | |
9e0c209e | 15 | aa: 20, |
1b1a35ee | 16 | //~^ ERROR struct `B` has no field named `aa` |
9e0c209e | 17 | bb: 20, |
1b1a35ee | 18 | //~^ ERROR struct `B` has no field named `bb` |
c34b1796 AL |
19 | }; |
20 | // local crate struct | |
21 | let l = A { | |
9e0c209e SL |
22 | aa: 20, |
23 | //~^ ERROR struct `A` has no field named `aa` | |
9e0c209e SL |
24 | bb: 20, |
25 | //~^ ERROR struct `A` has no field named `bb` | |
c34b1796 AL |
26 | }; |
27 | } |