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.
This commit is contained in:
Andy Russell
2019-01-02 17:01:03 -05:00
parent cae164753f
commit e3fe0ee97b
13 changed files with 117 additions and 40 deletions

View File

@@ -2,17 +2,13 @@ error[E0615]: attempted to take value of method `get_x` on type `Point`
--> $DIR/method-missing-call.rs:22:26
|
LL | .get_x;//~ ERROR attempted to take value of method `get_x` on type `Point`
| ^^^^^
|
= help: maybe a `()` to call it is missing?
| ^^^^^ help: use parentheses to call the method: `get_x()`
error[E0615]: attempted to take value of method `filter_map` on type `std::iter::Filter<std::iter::Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/method-missing-call.rs:27:20: 27:25]>, [closure@$DIR/method-missing-call.rs:28:23: 28:35]>`
--> $DIR/method-missing-call.rs:29:16
|
LL | .filter_map; //~ ERROR attempted to take value of method `filter_map` on type
| ^^^^^^^^^^
|
= help: maybe a `()` to call it is missing?
| ^^^^^^^^^^ help: use parentheses to call the method: `filter_map(...)`
error: aborting due to 2 previous errors