]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/private-field-ty-err.rs
Auto merge of #106780 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / ui / privacy / private-field-ty-err.rs
1 fn main() {
2     let x = foo::Foo::default();
3     if x.len {
4         //~^ ERROR field `len` of struct `Foo` is private
5         println!("foo");
6     }
7 }
8
9 mod foo {
10     #[derive(Default)]
11     pub struct Foo {
12         len: String,
13     }
14
15     impl Foo {
16         pub fn len(&self) -> usize {
17             42
18         }
19     }
20 }