diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-06 11:54:45 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-06 11:54:45 -0400 |
| commit | cc96efd7e30c92ff5135fbda2273ef86f4be6937 (patch) | |
| tree | ff17cf45a472b577b6d9f151458be0ff682189d3 /compiler/rustc_middle/src/ty/generics.rs | |
| parent | 60d146580c10036ce89e019422c6bc2fd9729b65 (diff) | |
| download | rust-cc96efd7e30c92ff5135fbda2273ef86f4be6937.tar.gz rust-cc96efd7e30c92ff5135fbda2273ef86f4be6937.zip | |
Stop unnecessarily taking GenericPredicates by &self
Diffstat (limited to 'compiler/rustc_middle/src/ty/generics.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/generics.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/ty/generics.rs b/compiler/rustc_middle/src/ty/generics.rs index 39c306a720f..8cb8e9af11c 100644 --- a/compiler/rustc_middle/src/ty/generics.rs +++ b/compiler/rustc_middle/src/ty/generics.rs @@ -376,7 +376,7 @@ pub struct GenericPredicates<'tcx> { impl<'tcx> GenericPredicates<'tcx> { pub fn instantiate( - &self, + self, tcx: TyCtxt<'tcx>, args: GenericArgsRef<'tcx>, ) -> InstantiatedPredicates<'tcx> { @@ -386,20 +386,20 @@ impl<'tcx> GenericPredicates<'tcx> { } pub fn instantiate_own( - &self, + self, tcx: TyCtxt<'tcx>, args: GenericArgsRef<'tcx>, ) -> impl Iterator<Item = (Clause<'tcx>, Span)> + DoubleEndedIterator + ExactSizeIterator { EarlyBinder::bind(self.predicates).iter_instantiated_copied(tcx, args) } - pub fn instantiate_own_identity(&self) -> impl Iterator<Item = (Clause<'tcx>, Span)> { + pub fn instantiate_own_identity(self) -> impl Iterator<Item = (Clause<'tcx>, Span)> { EarlyBinder::bind(self.predicates).iter_identity_copied() } #[instrument(level = "debug", skip(self, tcx))] fn instantiate_into( - &self, + self, tcx: TyCtxt<'tcx>, instantiated: &mut InstantiatedPredicates<'tcx>, args: GenericArgsRef<'tcx>, @@ -413,14 +413,14 @@ impl<'tcx> GenericPredicates<'tcx> { instantiated.spans.extend(self.predicates.iter().map(|(_, sp)| *sp)); } - pub fn instantiate_identity(&self, tcx: TyCtxt<'tcx>) -> InstantiatedPredicates<'tcx> { + pub fn instantiate_identity(self, tcx: TyCtxt<'tcx>) -> InstantiatedPredicates<'tcx> { let mut instantiated = InstantiatedPredicates::empty(); self.instantiate_identity_into(tcx, &mut instantiated); instantiated } fn instantiate_identity_into( - &self, + self, tcx: TyCtxt<'tcx>, instantiated: &mut InstantiatedPredicates<'tcx>, ) { |
