-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
rustc_parse: improve the error diagnostic for "missing let" #151960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
This comment has been minimized.
This comment has been minimized.
tests/ui/inference/issue-103587.rs
Outdated
| if Some(_) = x {} | ||
| //~^ ERROR mismatched types | ||
| //~^ ERROR missing `let` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parser is going to sucessfully parse this, but, the checking happens through the CondCheker(during the parsing process though) as it for all the cond after if and while https://github.com/rust-lang/rust/pull/151960/changes#diff-a278ef012eea7cc71e4c028d8c61c358e7a7cd7e35f846a41c75db09f893b998R4262. Does that constitute to changing from semantically invalidd to synthatically correct ?
If it is, I can limit the changes to
if Some(_) = y &&
let Some(_) = z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if your PR makes rustc reject the following code. If it does, then it's a breaking change.
fn main() {
#[cfg(false)]
if Some(_) = x {}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is a breaking change, I think I should remove it. What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should not introduce any breaking changes.
|
Reminder, once the PR becomes ready for a review, use |
|
This is a continuation of #151493 as commented in #151493 (comment) |
|
r? @estebank |
This comment was marked as resolved.
This comment was marked as resolved.
f77bad6 to
d1abdc0
Compare
d1abdc0 to
d2a30be
Compare
This comment has been minimized.
This comment has been minimized.
d2a30be to
d9c7b1b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
d9c7b1b to
85ca098
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ |
…estebank rustc_parse: improve the error diagnostic for "missing let"
…estebank rustc_parse: improve the error diagnostic for "missing let"
No description provided.