Reword incorrect self
token suggestion
This commit is contained in:
parent
2f517ce6f2
commit
520fb92c33
2 changed files with 5 additions and 5 deletions
|
@ -168,9 +168,9 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
|
||||||
if ["this", "my"].contains(&&*item_str.as_str())
|
if ["this", "my"].contains(&&*item_str.as_str())
|
||||||
&& self.self_value_is_available(path[0].ident.span, span)
|
&& self.self_value_is_available(path[0].ident.span, span)
|
||||||
{
|
{
|
||||||
err.span_suggestion(
|
err.span_suggestion_short(
|
||||||
span,
|
span,
|
||||||
"did you mean",
|
"you might have meant to use `self` here instead",
|
||||||
"self".to_string(),
|
"self".to_string(),
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,7 +5,7 @@ LL | this.x
|
||||||
| ^^^^
|
| ^^^^
|
||||||
| |
|
| |
|
||||||
| not found in this scope
|
| 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
|
error[E0425]: cannot find value `this` in this scope
|
||||||
--> $DIR/suggest-self.rs:26:9
|
--> $DIR/suggest-self.rs:26:9
|
||||||
|
@ -14,7 +14,7 @@ LL | this.foo()
|
||||||
| ^^^^
|
| ^^^^
|
||||||
| |
|
| |
|
||||||
| not found in this scope
|
| 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
|
error[E0425]: cannot find value `my` in this scope
|
||||||
--> $DIR/suggest-self.rs:31:9
|
--> $DIR/suggest-self.rs:31:9
|
||||||
|
@ -23,7 +23,7 @@ LL | my.bar()
|
||||||
| ^^
|
| ^^
|
||||||
| |
|
| |
|
||||||
| not found in this scope
|
| 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
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue