rust/src/test/ui/issues/issue-26472.rs
Andy Russell e3fe0ee97b
use structured suggestion for method calls
Furthermore, don't suggest calling the method if it is part of a place
expression, as this is invalid syntax.
2019-01-03 13:42:52 -05:00

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
}