Skip to content

fix: Improve inserted order for trait_impl_redundant_assoc_item#21695

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:redundant-item-order
Mar 31, 2026
Merged

fix: Improve inserted order for trait_impl_redundant_assoc_item#21695
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:redundant-item-order

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

Example

trait Marker {
    fn foo();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}$0
    fn baz() {}
}

Before this PR

trait Marker {
    fn missing();
    fn foo();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}
    fn baz() {}
}

After this PR

trait Marker {
    fn foo();
    fn missing();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}
    fn baz() {}
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2026
@ChayimFriedman2
Copy link
Copy Markdown
Contributor

I'm not sure we want this complexity. This is a small thing and if the items aren't in the same order as the trait it's not helpful anyway.

@rust-lang/rust-analyzer thoughts?

@flodiebold
Copy link
Copy Markdown
Member

IMO it's worth it, and the complexity is pretty well-contained.

@rustbot

This comment has been minimized.

@A4-Tacks A4-Tacks force-pushed the redundant-item-order branch from 711979e to 9d0083d Compare March 23, 2026 13:16
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 23, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Example
---
```rust
trait Marker {
    fn foo();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}$0
    fn baz() {}
}
```

**Before this PR**

```rust
trait Marker {
    fn missing();
    fn foo();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}
    fn baz() {}
}
```

**After this PR**

```rust
trait Marker {
    fn foo();
    fn missing();
    fn baz();
}
impl Marker for Foo {
    fn foo() {}
    fn missing() {}
    fn baz() {}
}
```
@A4-Tacks A4-Tacks force-pushed the redundant-item-order branch from 9d0083d to a6596c0 Compare March 23, 2026 13:29
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Mar 31, 2026
Merged via the queue into rust-lang:master with commit 0ee81de Mar 31, 2026
17 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2026
@A4-Tacks A4-Tacks deleted the redundant-item-order branch March 31, 2026 03:38
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.

4 participants