Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726

move 2 candidates into builtin candidate

having separate candidates for these isn't too helpful i think

r? types
This commit is contained in:
Matthias Krüger
2022-11-25 18:35:39 +01:00
committed by GitHub
8 changed files with 168 additions and 244 deletions

View File

@@ -1569,20 +1569,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
(TransmutabilityCandidate, _) | (_, TransmutabilityCandidate) => false,
// (*)
(
BuiltinCandidate { has_nested: false }
| DiscriminantKindCandidate
| PointeeCandidate
| ConstDestructCandidate(_),
_,
) => true,
(
_,
BuiltinCandidate { has_nested: false }
| DiscriminantKindCandidate
| PointeeCandidate
| ConstDestructCandidate(_),
) => false,
(BuiltinCandidate { has_nested: false } | ConstDestructCandidate(_), _) => true,
(_, BuiltinCandidate { has_nested: false } | ConstDestructCandidate(_)) => false,
(ParamCandidate(other), ParamCandidate(victim)) => {
let same_except_bound_vars = other.skip_binder().trait_ref