diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-11 08:53:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-11 08:53:23 -0700 |
| commit | e15fa4537cfa0b53e62ab627f34d98bcd5d3476c (patch) | |
| tree | 3fb2dabd4a60a9ecf9cfa12d365525c052edaae8 | |
| parent | 9f7b64eecba095c1efb0f6c5aab8f2ad93fc0df5 (diff) | |
| parent | 520fb92c33e8f446349c76103da5b204ff2ad9dc (diff) | |
| download | rust-e15fa4537cfa0b53e62ab627f34d98bcd5d3476c.tar.gz rust-e15fa4537cfa0b53e62ab627f34d98bcd5d3476c.zip | |
Rollup merge of #74197 - estebank:self-sugg, r=petrochenkov
Reword incorrect `self` token suggestion
| -rw-r--r-- | src/librustc_resolve/late/diagnostics.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/self/suggest-self.stderr | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs index 3537fb388d0..976a10e837f 100644 --- a/src/librustc_resolve/late/diagnostics.rs +++ b/src/librustc_resolve/late/diagnostics.rs @@ -168,9 +168,9 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> { if ["this", "my"].contains(&&*item_str.as_str()) && self.self_value_is_available(path[0].ident.span, span) { - err.span_suggestion( + err.span_suggestion_short( span, - "did you mean", + "you might have meant to use `self` here instead", "self".to_string(), Applicability::MaybeIncorrect, ); diff --git a/src/test/ui/self/suggest-self.stderr b/src/test/ui/self/suggest-self.stderr index 631e43c8694..0d38b9d87c5 100644 --- a/src/test/ui/self/suggest-self.stderr +++ b/src/test/ui/self/suggest-self.stderr @@ -5,7 +5,7 @@ LL | this.x | ^^^^ | | | not found in this scope - | help: did you mean: `self` + | help: you might have meant to use `self` here instead error[E0425]: cannot find value `this` in this scope --> $DIR/suggest-self.rs:26:9 @@ -14,7 +14,7 @@ LL | this.foo() | ^^^^ | | | not found in this scope - | help: did you mean: `self` + | help: you might have meant to use `self` here instead error[E0425]: cannot find value `my` in this scope --> $DIR/suggest-self.rs:31:9 @@ -23,7 +23,7 @@ LL | my.bar() | ^^ | | | not found in this scope - | help: did you mean: `self` + | help: you might have meant to use `self` here instead error: aborting due to 3 previous errors |
