Skip to content

Commit

Permalink
Convert a &Lrc<T> argument to Lrc<T>.
Browse files Browse the repository at this point in the history
It's slightly simpler.
  • Loading branch information
nnethercote committed Oct 7, 2024
1 parent 731469f commit 860cbcc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_infer/src/infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
},
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/region_constraints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -535,7 +535,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
definition_span,
hidden_ty,
member_region,
choice_regions: choice_regions.clone(),
choice_regions,
});
}

Expand Down

0 comments on commit 860cbcc

Please sign in to comment.