8000 Fix expand rest pattern in tuple and slice pattern by A4-Tacks · Pull Request #20731 · rust-lang/rust-analyzer · GitHub
[go: up one dir, main page]

Skip to content

Conversation

A4-Tacks
Copy link
Contributor

Assist: expand_tuple_rest_pattern

Fills fields by replacing rest pattern in tuple patterns.

Example

fn foo(bar: (char, i32, i32)) {
    let (ch, ..$0) = bar;
}

->

fn foo(bar: (char, i32, i32)) {
    let (ch, _1, _2) = bar;
}

Assist: expand_slice_rest_pattern

Fills fields by replacing rest pattern in slice patterns.

Example

fn foo(bar: [i32; 3]) {
    let [first, ..$0] = bar;
}

->

fn foo(bar: [i32; 3]) {
    let [first, _1, _2] = bar;
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 23, 2025
@A4-Tacks A4-Tacks force-pushed the expand-rest-pat-in-tuple-slice-pat branch from 0f485fb to b86bbdd Compare September 23, 2025 05:53
Copy link
Member
@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Edit) Oh, we have conflicts 😅

Assist: expand_tuple_rest_pattern

Fills fields by replacing rest pattern in tuple patterns.

Example
---
```
fn foo(bar: (char, i32, i32)) {
    let (ch, ..$0) = bar;
}
```
->
```
fn foo(bar: (char, i32, i32)) {
    let (ch, _1, _2) = bar;
}
```

---

Assist: expand_slice_rest_pattern

Fills fields by replacing rest pattern in slice patterns.

Example
---
```
fn foo(bar: [i32; 3]) {
    let [first, ..$0] = bar;
}
```
->
```
fn foo(bar: [i32; 3]) {
    let [first, _1, _2] = bar;
}
```
@A4-Tacks A4-Tacks force-pushed the expand-rest-pat-in-tuple-slice-pat branch from b86bbdd to 6d85fd7 Compare September 26, 2025 06:44
@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Sep 26, 2025
Merged via the queue into rust-lang:master with commit e81202c Sep 26, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2025
@A4-Tacks A4-Tacks deleted the expand-rest-pat-in-tuple-slice-pat branch September 26, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0