From 860cbccad993151ef87ec6c39fd1b2892b18972f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 7 Oct 2024 13:06:28 +1100 Subject: [PATCH] Convert a `&Lrc` argument to `Lrc`. It's slightly simpler. --- compiler/rustc_infer/src/infer/mod.rs | 2 +- compiler/rustc_infer/src/infer/opaque_types/mod.rs | 10 +++++++++- .../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 @@ pub fn member_constraint( definition_span: Span, hidden_ty: Ty<'tcx>, region: ty::Region<'tcx>, - in_regions: &Lrc>>, + in_regions: Lrc>>, ) { 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 @@ pub fn register_member_constraints( // 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 @@ pub(super) fn member_constraint( definition_span: Span, hidden_ty: Ty<'tcx>, member_region: ty::Region<'tcx>, - choice_regions: &Lrc>>, + choice_regions: Lrc>>, ) { debug!("member_constraint({:?} in {:#?})", member_region, choice_regions); @@ -535,7 +535,7 @@ pub(super) fn member_constraint( definition_span, hidden_ty, member_region, - choice_regions: choice_regions.clone(), + choice_regions, }); }