rust/src/test/ui/suggestions/call-on-missing.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
306 B
Rust
Raw Normal View History

2022-08-27 16:17:17 -05:00
struct Foo { i: i32 }
impl Foo {
fn bar(&self) {}
}
fn foo() -> Foo {
Foo { i: 1 }
}
fn main() {
foo.bar();
//~^ ERROR no method named `bar`
//~| HELP use parentheses to call this function
foo.i;
//~^ ERROR no field `i`
//~| HELP use parentheses to call this function
}