e3fe0ee97b
Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax.
14 lines
334 B
Rust
14 lines
334 B
Rust
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 `sub::S` is private
|
|
s.len = v; //~ ERROR field `len` of struct `sub::S` is private
|
|
}
|