diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-10-07 13:06:28 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-10-07 13:58:10 +1100 |
| commit | 860cbccad993151ef87ec6c39fd1b2892b18972f (patch) | |
| tree | e1af08881c095a0e5e365282a657db16aab23d02 | |
| parent | 731469fee50133528c1904a07da73e739db6f6c4 (diff) | |
| download | rust-860cbccad993151ef87ec6c39fd1b2892b18972f.tar.gz rust-860cbccad993151ef87ec6c39fd1b2892b18972f.zip | |
Convert a `&Lrc<T>` argument to `Lrc<T>`.
It's slightly simpler.
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/opaque_types/mod.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/region_constraints/mod.rs | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index 5fa1bf51634..040264586f6 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -776,7 +776,7 @@ impl<'tcx> InferCtxt<'tcx> { definition_span: Span, hidden_ty: Ty<'tcx>, region: ty::Region<'tcx>, - in_regions: &Lrc<Vec<ty::Region<'tcx>>>, + in_regions: Lrc<Vec<ty::Region<'tcx>>>, ) { self.inner.borrow_mut().unwrap_region_constraints().member_constraint( key, diff --git a/compiler/rustc_infer/src/infer/opaque_types/mod.rs b/compiler/rustc_infer/src/infer/opaque_types/mod.rs index 55c51bc856f..ba0a9b14ccb 100644 --- a/compiler/rustc_infer/src/infer/opaque_types/mod.rs +++ b/compiler/rustc_infer/src/infer/opaque_types/mod.rs @@ -359,7 +359,15 @@ impl<'tcx> InferCtxt<'tcx> { // not currently sound until we have existential regions. concrete_ty.visit_with(&mut ConstrainOpaqueTypeRegionVisitor { tcx: self.tcx, - op: |r| self.member_constraint(opaque_type_key, span, concrete_ty, r, &choice_regions), + op: |r| { + self.member_constraint( + opaque_type_key, + span, + concrete_ty, + r, + choice_regions.clone(), + ) + }, }); } } diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs index 82f7668b2d2..f22cfed0b71 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs @@ -522,7 +522,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> { definition_span: Span, hidden_ty: Ty<'tcx>, member_region: ty::Region<'tcx>, - choice_regions: &Lrc<Vec<ty::Region<'tcx>>>, + choice_regions: Lrc<Vec<ty::Region<'tcx>>>, ) { debug!("member_constraint({:?} in {:#?})", member_region, choice_regions); @@ -535,7 +535,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> { definition_span, hidden_ty, member_region, - choice_regions: choice_regions.clone(), + choice_regions, }); } |
