Skip to content

Commit 4943df3

Browse files
committed
somewhat related cleanup
1 parent 5e482d6 commit 4943df3

File tree

2 files changed

+4
-11
lines changed
  • src

2 files changed

+4
-11
lines changed

src/librustc_middle/ty/mod.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ impl<'tcx> Predicate<'tcx> {
12941294
// from the substitution and the value being substituted into, and
12951295
// this trick achieves that).
12961296

1297-
let substs = &trait_ref.skip_binder().substs;
1297+
let substs = trait_ref.skip_binder().substs;
12981298
let kind = self.kind();
12991299
let new = match kind {
13001300
&PredicateKind::Trait(ref binder, constness) => {
@@ -1547,13 +1547,6 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<PolyTraitRef<'tcx>> {
15471547
}
15481548
}
15491549

1550-
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&PolyTraitRef<'tcx>> {
1551-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1552-
ty::PredicateKind::Trait(self.value.to_poly_trait_predicate(), self.constness)
1553-
.to_predicate(tcx)
1554-
}
1555-
}
1556-
15571550
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
15581551
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
15591552
PredicateKind::RegionOutlives(*self).to_predicate(tcx)

src/librustc_trait_selection/traits/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ impl<'tcx> TraitAliasExpansionInfo<'tcx> {
5959
);
6060
}
6161

62-
pub fn trait_ref(&self) -> &ty::PolyTraitRef<'tcx> {
63-
&self.top().0
62+
pub fn trait_ref(&self) -> ty::PolyTraitRef<'tcx> {
63+
self.top().0
6464
}
6565

6666
pub fn top(&self) -> &(ty::PolyTraitRef<'tcx>, Span) {
@@ -109,7 +109,7 @@ impl<'tcx> TraitAliasExpander<'tcx> {
109109

110110
// Don't recurse if this trait alias is already on the stack for the DFS search.
111111
let anon_pred = anonymize_predicate(tcx, pred);
112-
if item.path.iter().rev().skip(1).any(|(tr, _)| {
112+
if item.path.iter().rev().skip(1).any(|&(tr, _)| {
113113
anonymize_predicate(tcx, tr.without_const().to_predicate(tcx)) == anon_pred
114114
}) {
115115
return false;

0 commit comments

Comments
 (0)