Prohibit conflicting bounds in dyn, even with different generics.#157710
Draft
theemathas wants to merge 2 commits into
Draft
Prohibit conflicting bounds in dyn, even with different generics.#157710theemathas wants to merge 2 commits into
dyn, even with different generics.#157710theemathas wants to merge 2 commits into
Conversation
…ics. See rust-lang#154662 These tests will be fixed in a subsequent commit.
Fixes rust-lang#154662 In a `dyn` type, if multiple bounds are specified for the same associated item, then we previously accepted them if the relevant trait's generics are different, even if the bounds conflict. This was unsound, since those generics could end up being instantiated with identical concrete types, causing the `dyn` type to have two different "values" for the same bound. Thus, we prohibit multiple bounds for the same associated item, even if the trait's generics are different. As a side effect of this change, we also now allow duplicated bounds in a `dyn` type, as long as the bounds are syntactically identical. The now-unused `OverlappingAsssocItemConstraints` will be removed in a subsequent commit.
7792410 to
67244f1
Compare
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
|
@bors try |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 10, 2026
Prohibit conflicting bounds in `dyn`, even with different generics.
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 10, 2026
Prohibit conflicting bounds in `dyn`, even with different generics.
Contributor
Member
|
@craterbot check |
Collaborator
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Draft
Contributor
Author
|
@craterbot cancel See #157814 |
Collaborator
|
🗑️ Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO: remove
OverlappingAsssocItemConstraintsTODO: write this PR description
TODO: Run crater and do a T-types FCP
r? @ghost