rustc_parse: improve the error diagnostic for "missing let"#151960
rustc_parse: improve the error diagnostic for "missing let"#151960Unique-Usman wants to merge 1 commit intorust-lang:mainfrom
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.
There was a problem hiding this comment.
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.
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.
Yeah, it is a breaking change, I think I should remove it. What do you think ?
There was a problem hiding this comment.
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.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
d2a30be to
d9c7b1b
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. |
No description provided.