rust-analyzer/crates
bors 6f3030f316 Auto merge of #17586 - ShoyuVanilla:tuple-arg-macro-rest, r=Veykril
Allow macro expansions into `RestPat` in tuple args work as ellipsis like plain `RestPat`

Fixes #17292

Currently, Rust Analyzer lowers `ast::Pat::RestPat` into `Pat::Missing` in general cases on the following lines;

ffbc5ad993/crates/hir-def/src/body/lower.rs (L1359-L1367)

And in some proper positions such as `TupleStruct(..)`, it is specially handed on the following lines;

ffbc5ad993/crates/hir-def/src/body/lower.rs (L1429-L1437)

This behavior is reasonable because rustc does similar things in
62c068feea/compiler/rustc_ast_lowering/src/pat.rs (L108-L111)
and
62c068feea/compiler/rustc_ast_lowering/src/pat.rs (L123-L142)

But this sometimes works differently because Rust Analyzer expands macros while ast lowering;

ffbc5ad993/crates/hir-def/src/body/lower.rs (L1386-L1398)
ffbc5ad993/crates/hir-def/src/body/lower.rs (L941-L963)
but rustc uses expanded ast in the corresponding tuple-handling process, so it does not have macro patterns there.
62c068feea/compiler/rustc_ast_lowering/src/pat.rs (L114)

So, if a macro expansion in a tuple arg results in `..`, rustc permits it like plain `..` pattern, but Rust Analyzer rejects it.
This is the root cause of #17292 and this PR allows macros expanded into `..` in a tuple arg position work as ellipsis like that.
2024-07-22 09:08:12 +00:00
..
base-db Make LRU opt-in 2024-07-19 18:38:08 +02:00
cfg Make CfgExpr slimmer 2024-07-21 14:50:44 +02:00
flycheck feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
hir Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
hir-def Auto merge of #17586 - ShoyuVanilla:tuple-arg-macro-rest, r=Veykril 2024-07-22 09:08:12 +00:00
hir-expand Make CfgExpr slimmer 2024-07-21 14:50:44 +02:00
hir-ty fix: Panic in debug profile for tuple deconstruct with arity mismatch 2024-07-21 02:37:37 +09:00
ide fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
ide-assists Auto merge of #17647 - joshka:jm/rename-commands, r=Veykril 2024-07-22 08:10:03 +00:00
ide-completion fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
ide-db Auto merge of #17647 - joshka:jm/rename-commands, r=Veykril 2024-07-22 08:10:03 +00:00
ide-diagnostics Auto merge of #17586 - ShoyuVanilla:tuple-arg-macro-rest, r=Veykril 2024-07-22 09:08:12 +00:00
ide-ssr Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +02:00
intern Support rustc_skip_during_method_dispatch 2024-07-17 11:46:36 +02:00
limit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
load-cargo Auto merge of #17639 - Veykril:salsa-perf, r=Veykril 2024-07-19 18:45:16 +00:00
mbe Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
parser Add missing dyn parse special cases in 2015 edition 2024-07-20 09:18:40 +02:00
paths Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
proc-macro-api Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv-cli Abstract proc-macro-srv protocol format 2024-06-30 16:56:30 +02:00
profile Fix stop_watch on linux 2024-07-07 08:40:41 +02:00
project-model Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykril 2024-07-19 14:56:56 +00:00
rust-analyzer Auto merge of #17647 - joshka:jm/rename-commands, r=Veykril 2024-07-22 08:10:03 +00:00
salsa Add back equality check that went missing 2024-07-19 20:39:09 +02:00
span Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
stdx Merge from rust-lang/rust 2024-07-11 20:06:05 +03:00
syntax Auto merge of #17641 - nyurik:optimize-refs, r=Veykril 2024-07-20 06:40:27 +00:00
test-fixture Prefer standard library paths over shorter extern deps re-exports 2024-07-21 09:14:17 +02:00
test-utils fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
text-edit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
toolchain Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
tt Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
vfs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
vfs-notify Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00