Skip to content

Commit 1fda8c2

Browse files
committed
somewhat related cleanup
1 parent 653f56a commit 1fda8c2

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
@@ -1302,7 +1302,7 @@ impl<'tcx> Predicate<'tcx> {
13021302
// from the substitution and the value being substituted into, and
13031303
// this trick achieves that).
13041304

1305-
let substs = &trait_ref.skip_binder().substs;
1305+
let substs = trait_ref.skip_binder().substs;
13061306
let kind = self.kind();
13071307
let new = match kind {
13081308
&PredicateKind::Trait(ref binder, constness) => {
@@ -1555,13 +1555,6 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<PolyTraitRef<'tcx>> {
15551555
}
15561556
}
15571557

1558-
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&PolyTraitRef<'tcx>> {
1559-
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1560-
ty::PredicateKind::Trait(self.value.to_poly_trait_predicate(), self.constness)
1561-
.to_predicate(tcx)
1562-
}
1563-
}
1564-
15651558
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
15661559
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
15671560
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)