Skip to content

Commit 1f98230

Browse files
committed
ToPredicate by value
1 parent 8ac1525 commit 1f98230

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/librustc_middle/ty/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1337,18 +1337,18 @@ impl<'tcx> ToPolyTraitRef<'tcx> for PolyTraitPredicate<'tcx> {
13371337
}
13381338

13391339
pub trait ToPredicate<'tcx> {
1340-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx>;
1340+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx>;
13411341
}
13421342

13431343
impl ToPredicate<'tcx> for PredicateKind<'tcx> {
13441344
#[inline(always)]
1345-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1346-
tcx.mk_predicate(*self)
1345+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1346+
tcx.mk_predicate(self)
13471347
}
13481348
}
13491349

13501350
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
1351-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1351+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13521352
ty::PredicateKind::Trait(
13531353
ty::Binder::dummy(ty::TraitPredicate { trait_ref: self.value }),
13541354
self.constness,
@@ -1358,7 +1358,7 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
13581358
}
13591359

13601360
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&TraitRef<'tcx>> {
1361-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1361+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13621362
ty::PredicateKind::Trait(
13631363
ty::Binder::dummy(ty::TraitPredicate { trait_ref: *self.value }),
13641364
self.constness,
@@ -1368,34 +1368,34 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&TraitRef<'tcx>> {
13681368
}
13691369

13701370
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<PolyTraitRef<'tcx>> {
1371-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1371+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13721372
ty::PredicateKind::Trait(self.value.to_poly_trait_predicate(), self.constness)
13731373
.to_predicate(tcx)
13741374
}
13751375
}
13761376

13771377
impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&PolyTraitRef<'tcx>> {
1378-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1378+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13791379
ty::PredicateKind::Trait(self.value.to_poly_trait_predicate(), self.constness)
13801380
.to_predicate(tcx)
13811381
}
13821382
}
13831383

13841384
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
1385-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1386-
PredicateKind::RegionOutlives(*self).to_predicate(tcx)
1385+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1386+
PredicateKind::RegionOutlives(self).to_predicate(tcx)
13871387
}
13881388
}
13891389

13901390
impl<'tcx> ToPredicate<'tcx> for PolyTypeOutlivesPredicate<'tcx> {
1391-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1392-
PredicateKind::TypeOutlives(*self).to_predicate(tcx)
1391+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1392+
PredicateKind::TypeOutlives(self).to_predicate(tcx)
13931393
}
13941394
}
13951395

13961396
impl<'tcx> ToPredicate<'tcx> for PolyProjectionPredicate<'tcx> {
1397-
fn to_predicate(&self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1398-
PredicateKind::Projection(*self).to_predicate(tcx)
1397+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1398+
PredicateKind::Projection(self).to_predicate(tcx)
13991399
}
14001400
}
14011401

0 commit comments

Comments
 (0)