Skip to content

feat: complete block .let in closure expression#21756

Open
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:fallback-let-closure
Open

feat: complete block .let in closure expression#21756
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:fallback-let-closure

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Mar 5, 2026

Partial of #21594

Example

fn main() {
    let bar = 2;
    let f = || bar.$0;
}

Before this PR

Cannot complete .let

After this PR

fn main() {
    let bar = 2;
    let f = || {
        let $1 = bar;
        $0
    };
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 5, 2026
@A4-Tacks A4-Tacks force-pushed the fallback-let-closure branch from af1ec19 to e58532f Compare March 5, 2026 10:26
Example
---
```rust
fn main() {
    let bar = 2;
    let f = || bar.$0;
}
```

**Before this PR**

Cannot complete `.let`

**After this PR**

```rust
fn main() {
    let bar = 2;
    let f = || {
        let $1 = bar;
        $0
    };
}
```
@A4-Tacks A4-Tacks force-pushed the fallback-let-closure branch from e58532f to ee82692 Compare March 5, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants