rust-analyzer/crates
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
..
base-db chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
cfg Gate #[test] expansion under cfg(test). 2024-09-30 00:12:45 +03:00
hir Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
hir-def Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
hir-expand Increase TOKEN_LIMIT for hir-expand 2024-10-18 17:36:24 -07:00
hir-ty Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
ide Auto merge of #18292 - roife:fix-issue-17427, r=Veykril 2024-10-14 14:51:57 +00:00
ide-assists Merge from rust-lang/rust 2024-10-08 14:25:39 +03:00
ide-completion Fix: Handle block exprs as modules when finding their parents 2024-10-01 14:05:15 +09:00
ide-db chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
ide-diagnostics Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
ide-ssr chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
intern Merge from rust-lang/rust 2024-09-25 09:00:53 +03:00
limit Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
load-cargo Gate #[test] expansion under cfg(test). 2024-09-30 00:12:45 +03:00
mbe Add missing rustc_private 2024-09-25 10:56:37 +03:00
parser feat: initial support for safe_kw in extern blocks 2024-10-20 17:12:52 +08:00
paths Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
proc-macro-api Properly set the working directory for proc-macro execution 2024-09-11 12:23:12 +02:00
proc-macro-srv fix: Fix TokenStream::to_string implementation dropping quotation marks 2024-08-29 08:45:35 +02:00
proc-macro-srv-cli Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
profile Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
project-model fix: Fix CI running analysis-stats incorrectly against the standard libraries 2024-10-18 12:34:55 +02:00
ra-salsa chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
rust-analyzer Clamp Position::character to line length 2024-10-18 15:07:13 +02:00
span chore: rename salsa to ra_salsa 2024-10-14 10:09:22 -04:00
stdx Use crossbeam-channel from the workspace 2024-08-09 23:48:03 +02:00
syntax Handle destructuring assignments uniformly 2024-10-20 19:09:51 +03:00
syntax-bridge When glueing together tokens from macros, merge their spans 2024-09-29 22:58:15 +03:00
test-fixture Always cache macro expansions' root node in Semantics 2024-09-17 00:19:39 +03:00
test-utils fix: Always explicitly set trait ref self types when lowering 2024-09-06 14:06:41 +02:00
text-edit Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
toolchain Replace [package.repository] = "…" of published crates with [package.repository.workspace] = true 2024-08-06 00:26:42 +02:00
tt Support the ${concat(...)} metavariable expression 2024-09-19 22:19:12 +03:00
vfs Rename object_safety to dyn_compatibility 2024-09-29 07:26:45 -04:00
vfs-notify Auto merge of #17843 - mo8it:flycheck, r=Veykril 2024-08-12 09:27:47 +00:00