Skip to content

Conversation

linyihai
Copy link
Contributor

This is an attempt to address the problem methion in #106304 (comment).

Copy the annotation to explain the fix

If the next Error::Extra ("next") doesn't next to current ("current")

fn foo(_: (), _: u32) {}
- foo("current", (), 1u32, "next")
+ foo((), 1u32)

If the previous error is not a Error::Extra, then do not trim the next comma

- foo((), "current", 42u32, "next")
+ foo((), 42u32)

Frankly, this is a fix from a test case and may not cover all scenarios

@rustbot
Copy link
Collaborator

rustbot commented Jun 17, 2024

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 17, 2024
@rust-log-analyzer

This comment has been minimized.

@linyihai linyihai changed the title Added more scenarios where commas need to be removed Added more scenarios where comma to be removed in the function arg Jun 17, 2024
@apiraino
Copy link
Contributor

r? compiler

@rustbot rustbot assigned petrochenkov and unassigned fmease Oct 17, 2024
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 19, 2024
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 20, 2024

📌 Commit f107082 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#126588 (Added more scenarios where comma to be removed in the function arg)
 - rust-lang#131728 (bootstrap: extract builder cargo to its own module)
 - rust-lang#131968 (Rip out old effects var handling code from traits)
 - rust-lang#131981 (Remove the `BoundConstness::NotConst` variant)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9ff4dab into rust-lang:master Oct 21, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2024
Rollup merge of rust-lang#126588 - linyihai:trim-extra-comma, r=petrochenkov

Added more scenarios where comma to be removed in the function arg

This is an attempt to address the problem methion in rust-lang#106304 (comment).

Copy the annotation to explain the fix

If the next Error::Extra ("next") doesn't next to current ("current")

```
fn foo(_: (), _: u32) {}
- foo("current", (), 1u32, "next")
+ foo((), 1u32)
```

If the previous error is not a `Error::Extra`, then do not trim the next comma

```
- foo((), "current", 42u32, "next")
+ foo((), 42u32)
```

Frankly, this is a fix from a test case and may not cover all scenarios
@bors
Copy link
Collaborator

bors commented Oct 21, 2024

⌛ Testing commit f107082 with merge 93742bd...

@linyihai linyihai deleted the trim-extra-comma branch October 21, 2024 08:57
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 7, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#126588 (Added more scenarios where comma to be removed in the function arg)
 - rust-lang#131728 (bootstrap: extract builder cargo to its own module)
 - rust-lang#131968 (Rip out old effects var handling code from traits)
 - rust-lang#131981 (Remove the `BoundConstness::NotConst` variant)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants