diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-01-22 16:30:15 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-01-27 01:18:18 +0100 |
| commit | ec61761e465a61869d13e89274afa02257aba6d7 (patch) | |
| tree | 2391a0566e8bc84cb39dd5267edd35d56aac1b15 /src/librustc/ty | |
| parent | a237641c7df8125b89b8f9c2a3594964ba8188f8 (diff) | |
| download | rust-ec61761e465a61869d13e89274afa02257aba6d7.tar.gz rust-ec61761e465a61869d13e89274afa02257aba6d7.zip | |
don't clone types that are copy, round two.
Diffstat (limited to 'src/librustc/ty')
| -rw-r--r-- | src/librustc/ty/context.rs | 2 | ||||
| -rw-r--r-- | src/librustc/ty/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc/ty/sty.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index a51f0f7f24c..355df86046f 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -1294,7 +1294,7 @@ impl<'tcx> TyCtxt<'tcx> { // statements within the query system and we'd run into endless // recursion otherwise. let (crate_name, crate_disambiguator) = if def_id.is_local() { - (self.crate_name.clone(), self.sess.local_crate_disambiguator()) + (self.crate_name, self.sess.local_crate_disambiguator()) } else { ( self.cstore.crate_name_untracked(def_id.krate), diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index e67131b9164..4889f751f60 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1326,7 +1326,7 @@ pub trait ToPolyTraitRef<'tcx> { impl<'tcx> ToPolyTraitRef<'tcx> for TraitRef<'tcx> { fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx> { - ty::Binder::dummy(self.clone()) + ty::Binder::dummy(*self) } } @@ -1372,19 +1372,19 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&PolyTraitRef<'tcx>> { impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> { fn to_predicate(&self) -> Predicate<'tcx> { - Predicate::RegionOutlives(self.clone()) + Predicate::RegionOutlives(*self) } } impl<'tcx> ToPredicate<'tcx> for PolyTypeOutlivesPredicate<'tcx> { fn to_predicate(&self) -> Predicate<'tcx> { - Predicate::TypeOutlives(self.clone()) + Predicate::TypeOutlives(*self) } } impl<'tcx> ToPredicate<'tcx> for PolyProjectionPredicate<'tcx> { fn to_predicate(&self) -> Predicate<'tcx> { - Predicate::Projection(self.clone()) + Predicate::Projection(*self) } } diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 837b2fcc500..dffe86d9462 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -838,7 +838,7 @@ impl<'tcx> PolyTraitRef<'tcx> { pub fn to_poly_trait_predicate(&self) -> ty::PolyTraitPredicate<'tcx> { // Note that we preserve binding levels - Binder(ty::TraitPredicate { trait_ref: self.skip_binder().clone() }) + Binder(ty::TraitPredicate { trait_ref: *self.skip_binder() }) } } |
