summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-06 10:30:05 +0000
committerbors <bors@rust-lang.org>2019-01-06 10:30:05 +0000
commite628196d41834971e70b3eb7d40a9d962b4d4da6 (patch)
tree7e40bc09eed45db3c1accaa9ec3f00c90366a761 /src/test/ui/error-codes
parentaf2c159cc38f251a8e7d43cf1f98806392fbddcf (diff)
parente3fe0ee97b95abd13e257fa92c70248c0746165c (diff)
downloadrust-e628196d41834971e70b3eb7d40a9d962b4d4da6.tar.gz
rust-e628196d41834971e70b3eb7d40a9d962b4d4da6.zip
Auto merge of #57291 - euclio:method-call-suggestion, r=estebank
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.

I'm thinking it might be worth putting a label on the method assignment span like "this is a method" and removing the span from the "methods are immutable" text so it isn't reported twice.

The suggestions in `src/test/ui/did_you_mean/issue-40396.stderr` are suboptimal. I could check if the containing expression is `BinOp`, but I'm not sure if that's general enough. Any ideas?

r? @estebank
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0615.stderr4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/test/ui/error-codes/E0615.stderr b/src/test/ui/error-codes/E0615.stderr
index 423948666db..d86ee5b9b4b 100644
--- a/src/test/ui/error-codes/E0615.stderr
+++ b/src/test/ui/error-codes/E0615.stderr
@@ -2,9 +2,7 @@ error[E0615]: attempted to take value of method `method` on type `Foo`
   --> $DIR/E0615.rs:11:7
    |
 LL |     f.method; //~ ERROR E0615
-   |       ^^^^^^
-   |
-   = help: maybe a `()` to call it is missing?
+   |       ^^^^^^ help: use parentheses to call the method: `method()`
 
 error: aborting due to previous error