2016-05-02 14:52:48 +02:00
|
|
|
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();
|
2020-09-02 10:40:56 +03:00
|
|
|
let v = s.len; //~ ERROR field `len` of struct `S` is private
|
|
|
|
s.len = v; //~ ERROR field `len` of struct `S` is private
|
2016-05-02 14:52:48 +02:00
|
|
|
}
|