]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/private-field.rs
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / suggestions / private-field.rs
1 // compile-flags: --crate-type lib
2 pub struct S {
3     pub val: string::MyString,
4 }
5
6 pub fn test(s: S) {
7     dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609]
8 }
9
10 pub(crate) mod string {
11
12     pub struct MyString {
13         buf: MyVec,
14     }
15
16     struct MyVec {
17         cap: usize,
18     }
19 }