summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs/suggest-private-fields.rs
blob: 8267a82fe2aea980b0ba24eb87ab451ab1a21429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// aux-build:struct_field_privacy.rs

extern crate struct_field_privacy as xc;

use xc::B;

struct A {
    pub a: u32,
    b: u32,
}

fn main () {
    // external crate struct
    let k = B {
        aa: 20,
        //~^ ERROR struct `B` has no field named `aa`
        bb: 20,
        //~^ ERROR struct `B` has no field named `bb`
    };
    // local crate struct
    let l = A {
        aa: 20,
        //~^ ERROR struct `A` has no field named `aa`
        bb: 20,
        //~^ ERROR struct `A` has no field named `bb`
    };
}