forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#60061 - estebank:field-sugg, r=davidtwco
Change suggestion of field when not in self context Fix rust-lang#60057.
- Loading branch information
Showing
9 changed files
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
struct A { | ||
banana: u8, | ||
} | ||
|
||
impl A { | ||
fn new(peach: u8) -> A { | ||
A { | ||
banana: banana //~ ERROR cannot find value `banana` in this scope | ||
} | ||
} | ||
|
||
fn foo(&self, peach: u8) -> A { | ||
A { | ||
banana: banana //~ ERROR cannot find value `banana` in this scope | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0425]: cannot find value `banana` in this scope | ||
--> $DIR/issue-60057.rs:8:21 | ||
| | ||
LL | banana: banana | ||
| ^^^^^^ a field by this name exists in `Self` | ||
|
||
error[E0425]: cannot find value `banana` in this scope | ||
--> $DIR/issue-60057.rs:14:21 | ||
| | ||
LL | banana: banana | ||
| ^^^^^^ help: you might have meant to use the available field: `self.banana` | ||
|
||
error[E0601]: `main` function not found in crate `issue_60057` | ||
| | ||
= note: consider adding a `main` function to `$DIR/issue-60057.rs` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0425, E0601. | ||
For more information about an error, try `rustc --explain E0425`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters