Don't refcount PlaceholderIndices.

It's not necessary.
This commit is contained in:
Nicholas Nethercote 2024-11-01 09:19:03 +11:00
parent fe3c49fe9a
commit 801b150737
3 changed files with 3 additions and 5 deletions

View File

@ -126,7 +126,6 @@ pub(crate) fn compute_regions<'a, 'tcx>(
universe_causes,
type_tests,
} = constraints;
let placeholder_indices = Rc::new(placeholder_indices);
// If requested, emit legacy polonius facts.
polonius::emit_facts(

View File

@ -395,7 +395,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
pub(crate) fn new(
infcx: &BorrowckInferCtxt<'tcx>,
var_infos: VarInfos,
placeholder_indices: Rc<PlaceholderIndices>,
placeholder_indices: PlaceholderIndices,
universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
mut outlives_constraints: OutlivesConstraintSet<'tcx>,
member_constraints_in: MemberConstraintSet<'tcx, RegionVid>,

View File

@ -258,10 +258,9 @@ impl PlaceholderIndices {
/// Here, the variable `'0` would contain the free region `'a`,
/// because (since it is returned) it must live for at least `'a`. But
/// it would also contain various points from within the function.
#[derive(Clone)]
pub(crate) struct RegionValues<N: Idx> {
elements: Rc<DenseLocationMap>,
placeholder_indices: Rc<PlaceholderIndices>,
placeholder_indices: PlaceholderIndices,
points: SparseIntervalMatrix<N, PointIndex>,
free_regions: SparseBitMatrix<N, RegionVid>,
@ -277,7 +276,7 @@ impl<N: Idx> RegionValues<N> {
pub(crate) fn new(
elements: Rc<DenseLocationMap>,
num_universal_regions: usize,
placeholder_indices: Rc<PlaceholderIndices>,
placeholder_indices: PlaceholderIndices,
) -> Self {
let num_points = elements.num_points();
let num_placeholders = placeholder_indices.len();