rust-analyzer/crates/syntax/src
Chayim Refael Friedman 61f162a43d Handle destructuring assignments uniformly
Instead of lowering them to `<expr> = <expr>`, then hacking on-demand to resolve them, we lower them to `<pat> = <expr>`, and use the pattern infrastructure to handle them. It turns out, destructuring assignments are surprisingly similar to pattern bindings, and so only minor modifications are needed.

This fixes few bugs that arose because of the non-uniform handling (for example, MIR lowering not handling slice and record patterns, and closure capture calculation not handling destructuring assignments at all), and furthermore, guarantees we won't have such bugs in the future, since the programmer will always have to explicitly handle `Expr::Assignment`.

Tests don't pass yet; that's because the generated patterns do not exist in the source map. The next commit will fix that.
2024-10-20 19:09:51 +03:00
..
ast Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
parsing Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
syntax_editor internal: Add SyntaxFactory to ease generating nodes with syntax mappings 2024-09-26 16:28:48 -04:00
validation Implement unsafe attribute parsing 2024-05-06 12:11:29 +02:00
algo.rs Avoid ref when using format! in compiler 2024-07-19 14:41:59 -04:00
ast.rs Rename object_safety to dyn_compatibility 2024-09-29 07:26:45 -04:00
fuzz.rs internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
hacks.rs Remove check that text of parse_expr_from_str() matches the produced parsed tree 2024-09-19 14:18:07 +03:00
lib.rs Auto merge of #18038 - roife:fix-issue-18034, r=Veykril 2024-09-12 08:21:37 +00:00
parsing.rs Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
ptr.rs internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
syntax_editor.rs internal: Add SyntaxFactory to ease generating nodes with syntax mappings 2024-09-26 16:28:48 -04:00
syntax_error.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
syntax_node.rs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
ted.rs Complete desugared and resugared async fn in trait impls 2024-09-01 11:22:50 +02:00
tests.rs internal: Remove AbsPathBuf::TryFrom impl that checks too many things at once 2024-08-02 11:08:19 +02:00
token_text.rs Merge commit '457b966b17' into sync-from-ra 2023-12-11 11:16:01 +02:00
utils.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
validation.rs chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00