Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errors
Avoid `&Lrc<T>` in various places Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better. r? `@oli-obk`
This commit is contained in:
commit
df61a0b1b2
16 changed files with 45 additions and 39 deletions
|
@ -749,7 +749,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,
|
||||
|
|
|
@ -358,7 +358,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(),
|
||||
)
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue