Skip to content

Do not continue past rustc_resolve when encountering duplicated items - #162831

Open
estebank wants to merge 2 commits into
rust-lang:mainfrom
estebank:duplicated-items
Open

estebank wants to merge 2 commits into
rust-lang:mainfrom
estebank:duplicated-items

Conversation

@estebank

@estebank estebank commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Duplicated items cause lots of confusing knock down errors. This change side-steps some known ICEs, and reduces the verbosity of crates with duplicated items at the cost of not emitting every error that we could.

Noticed just how problematic these can be while looking at #160695, as #[derive]s are particularly prone to the kind of confusion these duplicates cause.

Fix #120873, fix #123690.

r? @petrochenkov

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 15, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

Duplicated items cause lots of confusing knock down errors. This change side-steps some known ICEs, and reduces the verbosity of crates with duplicated items at the cost of not emitting every error that we could.
120873 -> `tests/ui/resolve/multiple_definitions_attribute_merging.rs`
          (already existing)
123690 -> `tests/ui/resolve/duplicated-enum-variant.rs`
155482 -> `tests/ui/resolve/duplicated-item-in-const-generics.rs`
	  Added two cases from the report that still ICE.
@rustbot

rustbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: Unsigned value 0x100 does not fit in 8 bits ICE: builtin derive created an unaligned reference

4 participants