Auto merge of #77720 - matthewjasper:fix-trait-ices, r=nikomatsakis
Fix trait solving ICEs - Selection candidates that are known to be applicable are preferred over candidates that are not. - Don't ICE if a projection/object candidate is no longer applicable (this can happen due to cycles in normalization) - Normalize supertraits when finding trait object candidates Closes #77653 Closes #77656 r? `@nikomatsakis`
This commit is contained in:
commit
a9cd294cf2
6 changed files with 141 additions and 86 deletions
|
@ -127,7 +127,10 @@ pub enum SelectionCandidate<'tcx> {
|
|||
|
||||
TraitAliasCandidate(DefId),
|
||||
|
||||
ObjectCandidate,
|
||||
/// Matching `dyn Trait` with a supertrait of `Trait`. The index is the
|
||||
/// position in the iterator returned by
|
||||
/// `rustc_infer::traits::util::supertraits`.
|
||||
ObjectCandidate(usize),
|
||||
|
||||
BuiltinObjectCandidate,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue