Skip to content

feat: complete block .let in closure expression#21756

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:fallback-let-closure
Mar 20, 2026
Merged

feat: complete block .let in closure expression#21756
ChayimFriedman2 merged 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
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Mar 20, 2026
Merged via the queue into rust-lang:master with commit 5c85041 Mar 20, 2026
17 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 20, 2026
@A4-Tacks A4-Tacks deleted the fallback-let-closure branch March 20, 2026 10:45
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