rust/tests/ui/suggestions/private-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
294 B
Rust
Raw Normal View History

2022-01-18 10:09:17 -06:00
// 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,
}
}