summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/private-field.rs
blob: 1cc4d2a4d066e72a77804380b7d24afb29a4d0a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// compile-flags: --crate-type lib
pub struct S {
    pub val: string::MyString,
}

pub fn test(s: S) {
    dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609]
}

pub(crate) mod string {

    pub struct MyString {
        buf: MyVec,
    }

    struct MyVec {
        cap: usize,
    }
}