Skip to content

feat: offer block let fallback postfix complete#21594

Merged
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
A4-Tacks:fallback-let-comp-block
Feb 18, 2026
Merged

feat: offer block let fallback postfix complete#21594
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
A4-Tacks:fallback-let-comp-block

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented Feb 6, 2026

Related #5290 (comment)

@flodiebold Can this close the issue?

Um... it's a bit strange if it's inside the chain call,
e.g foo.bar().let.baz() -> {let $1 = foo.bar();$0}.baz()

Or only offer when the parent is a MatchArm?

Example

fn main() {
    match 2 {
        bar => bar.$0
    }
}

->

fn main() {
    match 2 {
        bar => {
            let $1 = bar;
            $0
        }
    }
}

Example
---
```rust
fn main() {
    match 2 {
        bar => bar.$0
    }
}
```
->
```rust
fn main() {
    match 2 {
        bar => {
            let $1 = bar;
            $0
        }
    }
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2026
@ChayimFriedman2
Copy link
Copy Markdown
Contributor

I don't think we want this in general expressions, but inside a match arm it'll be nice to have both postfix and normal let (that complete the block as well), I've wanted this several times.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into rust-lang:master with commit 3cf298f Feb 18, 2026
16 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 18, 2026
@A4-Tacks A4-Tacks deleted the fallback-let-comp-block branch February 18, 2026 13:13
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