2016-05-02 07:52:48 -05: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();
|
2019-01-02 16:01:03 -06:00
|
|
|
let v = s.len; //~ ERROR field `len` of struct `sub::S` is private
|
|
|
|
s.len = v; //~ ERROR field `len` of struct `sub::S` is private
|
2016-05-02 07:52:48 -05:00
|
|
|
}
|