Skip to content

Commit

Permalink
Don't refcount PlaceholderIndices.
Browse files Browse the repository at this point in the history
It's not necessary.
  • Loading branch information
nnethercote committed Nov 19, 2024
1 parent fe3c49f commit 801b150
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/src/nll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_borrowck/src/region_infer/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,

Expand All @@ -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();
Expand Down

0 comments on commit 801b150

Please sign in to comment.