Skip to content

fix: improve fn_param adds comma location#22390

Open
A4-Tacks wants to merge 2 commits into
rust-lang:masterfrom
A4-Tacks:fn-param-comma-edit
Open

fix: improve fn_param adds comma location#22390
A4-Tacks wants to merge 2 commits into
rust-lang:masterfrom
A4-Tacks:fn-param-comma-edit

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented May 17, 2026

Example

fn bar(file_id: usize) {}
fn baz(
    foo: ()
    file$0
) {}

Before this PR

fn bar(file_id: usize) {}
fn baz(
    foo: ()
    , file_id: usize
) {}

After this PR

fn bar(file_id: usize) {}
fn baz(
    foo: (),
    file_id: usize,
) {}

fn bar(file_id: usize) {}
fn baz(/*...*/ file$0) {}

Before this PR

fn bar(file_id: usize) {}
fn baz(/*...*/ , file_id: usize) {}

After this PR

fn bar(file_id: usize) {}
fn baz(/*...*/ file_id: usize) {}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 17, 2026
@A4-Tacks A4-Tacks force-pushed the fn-param-comma-edit branch from 4693583 to 9eb0850 Compare May 17, 2026 11:50
Example
---
```rust
fn bar(file_id: usize) {}
fn baz(
    foo: ()
    file$0
) {}
```

**Before this PR**

```rust
fn bar(file_id: usize) {}
fn baz(
    foo: ()
    , file_id: usize
) {}
```

**After this PR**

```rust
fn bar(file_id: usize) {}
fn baz(
    foo: (),
    file_id: usize,
) {}
```
@A4-Tacks A4-Tacks force-pushed the fn-param-comma-edit branch from 9eb0850 to fe6fdb7 Compare May 17, 2026 12:08
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