summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-26472.rs
blob: b100c59ad0bd7507eabcc8964b5ce52994abbb25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
mod sub {
    pub struct S { len: usize }
    impl S {
        pub fn new() -> S { S { len: 0 } }
        pub fn len(&self) -> usize { self.len }
    }
}

fn main() {
    let s = sub::S::new();
    let v = s.len; //~ ERROR field `len` of struct `S` is private
    s.len = v; //~ ERROR field `len` of struct `S` is private
}