Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Nov 13, 2025

Fixes #20987

Example

fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(fo$0);
}

Before this PR

fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(foo();$0);
}

After this PR

fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(foo()$0);
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2025
@A4-Tacks A4-Tacks force-pushed the no-semicolon-in-arg-list branch from 8fdac80 to b55c904 Compare November 13, 2025 11:13
Example
---
```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(fo$0);
}
```

**Before this PR**

```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(foo();$0);
}
```

**After this PR**

```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
    baz(foo()$0);
}
```
@A4-Tacks A4-Tacks force-pushed the no-semicolon-in-arg-list branch from b55c904 to 7890856 Compare November 13, 2025 11:26
@ChayimFriedman2 ChayimFriedman2 self-requested a review November 16, 2025 23:54
@ChayimFriedman2
Copy link
Contributor

I want to review this PR, since I implemented the original logic and I remember I had few attempts to fix this, I want to make sure this PR is doing things correctly.

@A4-Tacks
Copy link
Member Author

I want to review this PR

Can you review this?

Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

Thought hard and couldn't find a way to break this, so, LGTM.

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Dec 16, 2025
Merged via the queue into rust-lang:master with commit 87cfc88 Dec 16, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 16, 2025
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.

Completing a function with return type () inserts a semicolon even when in an expression

3 participants