-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[rustc_parse] Forbid let
s in certain places
#97295
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Sorry for taking so long to review. I don't think this should be implemented like this. I think we should be explicitly adding code to allow let-chains in Even if this is the right approach, I think this current implementation is missing a lot of positions where we'd accidentally stabilize parsing #[cfg(ignore)]
fn foo() {
let _ = f(let y = 1);
|x| let 1 = 2;
array[let x = y];
} |
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.
(whoops, should've left comment here)
7f23fe1
to
76b20e0
Compare
Done. Thanks for the review |
src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
Show resolved
Hide resolved
☔ The latest upstream changes (presumably #97474) made this pull request unmergeable. Please resolve the merge conflicts. |
862b590
to
5eeb48d
Compare
@rustbot label +S-waiting-on-review -S-waiting-on-author If possible, I would like to tackle https://github.com/rust-lang/rust/pull/97295/files#diff-52ef6fde627bdaac8e79bcf67beac39ef4cd9a2a0bd0ff7e3ec69dd0ce74af94 and duplicated diagnostics in a following PR. |
This comment has been minimized.
This comment has been minimized.
Alright, this is a good first step then. @bors r+ |
📌 Commit 1c460819c4dbd77dd22df0292a5b6052347245ef has been approved by |
☔ The latest upstream changes (presumably #98447) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r- please fix the issues then i can re-approve |
1c46081
to
7475867
Compare
Done |
@bors r+ |
📌 Commit 7475867 has been approved by |
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…ompiler-errors [rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve rust-lang#94927 (comment) but feel free to point any other places.
…askrgr Rollup of 11 pull requests Successful merges: - rust-lang#97140 (std: use an event-flag-based thread parker on SOLID) - rust-lang#97295 ([rustc_parse] Forbid `let`s in certain places) - rust-lang#97743 (make const_err show up in future breakage reports) - rust-lang#97908 (Stabilize NonZero* checked operations constness.) - rust-lang#98297 (Transform help popup into a pocket menu) - rust-lang#98428 (macros: use typed identifiers in diag and subdiag derive) - rust-lang#98528 (Respect --color when building rustbuild itself) - rust-lang#98535 (Add regression test for generic const in rustdoc) - rust-lang#98538 (Add a ui test for issue rust-lang#91883) - rust-lang#98540 (Add regression test for rust-lang#87558) - rust-lang#98541 (Update `std::alloc::System` doc example code style) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Currently only forbids in locals to resolve #94927 (comment) but feel free to point any other places.