somewhat related cleanup
This commit is contained in:
parent
653f56af53
commit
1fda8c207e
2 changed files with 4 additions and 11 deletions
|
@ -1302,7 +1302,7 @@ impl<'tcx> Predicate<'tcx> {
|
|||
// from the substitution and the value being substituted into, and
|
||||
// this trick achieves that).
|
||||
|
||||
let substs = &trait_ref.skip_binder().substs;
|
||||
let substs = trait_ref.skip_binder().substs;
|
||||
let kind = self.kind();
|
||||
let new = match kind {
|
||||
&PredicateKind::Trait(ref binder, constness) => {
|
||||
|
@ -1555,13 +1555,6 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<PolyTraitRef<'tcx>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&PolyTraitRef<'tcx>> {
|
||||
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
|
||||
ty::PredicateKind::Trait(self.value.to_poly_trait_predicate(), self.constness)
|
||||
.to_predicate(tcx)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
|
||||
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
|
||||
PredicateKind::RegionOutlives(self).to_predicate(tcx)
|
||||
|
|
|
@ -59,8 +59,8 @@ impl<'tcx> TraitAliasExpansionInfo<'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
pub fn trait_ref(&self) -> &ty::PolyTraitRef<'tcx> {
|
||||
&self.top().0
|
||||
pub fn trait_ref(&self) -> ty::PolyTraitRef<'tcx> {
|
||||
self.top().0
|
||||
}
|
||||
|
||||
pub fn top(&self) -> &(ty::PolyTraitRef<'tcx>, Span) {
|
||||
|
@ -109,7 +109,7 @@ impl<'tcx> TraitAliasExpander<'tcx> {
|
|||
|
||||
// Don't recurse if this trait alias is already on the stack for the DFS search.
|
||||
let anon_pred = anonymize_predicate(tcx, pred);
|
||||
if item.path.iter().rev().skip(1).any(|(tr, _)| {
|
||||
if item.path.iter().rev().skip(1).any(|&(tr, _)| {
|
||||
anonymize_predicate(tcx, tr.without_const().to_predicate(tcx)) == anon_pred
|
||||
}) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue