mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
9997c51496
Fix last `let_chains` blocker In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`. This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce. To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍 In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework. cc https://github.com/rust-lang/rust/pull/94927 cc https://github.com/rust-lang/rust/issues/53667 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |