Don't merge distinct impl candidates - #161386
Open
bit-aloo wants to merge 3 commits into
Open
Conversation
Member
Author
|
I am not very confident about fallout bless's: 994cca7 |
This comment has been minimized.
This comment has been minimized.
lcnr
reviewed
Aug 20, 2026
| trait_def_id: I::TraitId, | ||
| candidates: &[Candidate<I>], | ||
| ) -> Option<(CanonicalResponse<I>, MergeCandidateInfo)> { | ||
| let mut impls = candidates.iter().filter(|c| matches!(c.source, CandidateSource::Impl(_))); |
Contributor
There was a problem hiding this comment.
should do the same with builtin impls 😁
lcnr
reviewed
Aug 20, 2026
| // remaining candidates. | ||
| let proven_via = if candidates | ||
| .iter() | ||
| .all(|c| matches!(c.source, CandidateSource::ParamEnv(ParamEnvSource::Global))) |
Contributor
There was a problem hiding this comment.
effectively this match is a check whether we should merge candidates or not 😁
because these are all either impl, builtin impl, or global where-bounds
lcnr
reviewed
Aug 20, 2026
| if impls.nth(1).is_some() && !self.cx().trait_is_marker(trait_def_id) { | ||
| return None; | ||
| } | ||
| self.try_merge_candidates(candidates) |
Contributor
There was a problem hiding this comment.
why do we need to call try_merge_candidates if impls are Some?
Contributor
|
this fails to bootstrap, probably something related to specialization 🤔 😁 please minimize and look into why |
rust-cloud-vms
Bot
force-pushed
the
2026-08-17-merge-impls
branch
from
August 20, 2026 07:53
994cca7 to
36d20a8
Compare
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
Contributor
|
@rustbot author |
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.
closes: rust-lang/trait-system-refactor-initiative#35
r? lcnr