Suggest let for possible binding with ty by chenyukang · Pull Request #111120 ·...
source link: https://github.com/rust-lang/rust/pull/111120
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Collaborator
I don't think this is a great place to put it (the error message is very specialized for statements, but the location is pretty generic), I'd prefer it if you found a more specific place. After fixing your ICE locally, this snippet produces the following output:
struct A {
: u8 =,
}
error: expected identifier, found `:`
--> uwu.rs:6:5
|
5 | struct A {
| - while parsing this struct
6 | : u8 =,
| ^ expected identifier
|
help: you might have meant to introduce a new binding
|
5 | struct A let {
| +++
which, while this snippet is totally nonsensical, is not very good.
compiler/rustc_parse/src/parser/diagnostics.rs
Outdated Show resolved
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Member
Author
@rustbot ready |
added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
That implementation is a lot nicer! r=me after addressing the comment
compiler/rustc_parse/src/parser/diagnostics.rs
Outdated Show resolved
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Member
Author
@bors r=Nilstrieb |
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK