File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ struct Foo { i : i32 }
2+
3+ impl Foo {
4+ fn bar ( & self ) { }
5+ }
6+
7+ fn foo ( ) -> Foo {
8+ Foo { i : 1 }
9+ }
10+
11+ fn main ( ) {
12+ foo. bar ( ) ;
13+ //~^ ERROR no method named `bar`
14+ //~| HELP use parentheses to call this function
15+
16+ foo. i ;
17+ //~^ ERROR no field `i`
18+ //~| HELP use parentheses to call this function
19+ }
Original file line number Diff line number Diff line change 1+ error[E0599]: no method named `bar` found for fn item `fn() -> Foo {foo}` in the current scope
2+ --> $DIR/call-on-missing.rs:12:9
3+ |
4+ LL | foo.bar();
5+ | ^^^ method not found in `fn() -> Foo {foo}`
6+ |
7+ help: use parentheses to call this function
8+ |
9+ LL | foo().bar();
10+ | ++
11+
12+ error[E0609]: no field `i` on type `fn() -> Foo {foo}`
13+ --> $DIR/call-on-missing.rs:16:9
14+ |
15+ LL | foo.i;
16+ | ^
17+ |
18+ help: use parentheses to call this function
19+ |
20+ LL | foo().i;
21+ | ++
22+
23+ error: aborting due to 2 previous errors
24+
25+ Some errors have detailed explanations: E0599, E0609.
26+ For more information about an error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments