Skip to content

Commit 801b150

Browse files
committed
Don't refcount PlaceholderIndices.
It's not necessary.
1 parent fe3c49f commit 801b150

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Diff for: compiler/rustc_borrowck/src/nll.rs

-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ pub(crate) fn compute_regions<'a, 'tcx>(
126126
universe_causes,
127127
type_tests,
128128
} = constraints;
129-
let placeholder_indices = Rc::new(placeholder_indices);
130129

131130
// If requested, emit legacy polonius facts.
132131
polonius::emit_facts(

Diff for: compiler/rustc_borrowck/src/region_infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
395395
pub(crate) fn new(
396396
infcx: &BorrowckInferCtxt<'tcx>,
397397
var_infos: VarInfos,
398-
placeholder_indices: Rc<PlaceholderIndices>,
398+
placeholder_indices: PlaceholderIndices,
399399
universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
400400
mut outlives_constraints: OutlivesConstraintSet<'tcx>,
401401
member_constraints_in: MemberConstraintSet<'tcx, RegionVid>,

Diff for: compiler/rustc_borrowck/src/region_infer/values.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,9 @@ impl PlaceholderIndices {
258258
/// Here, the variable `'0` would contain the free region `'a`,
259259
/// because (since it is returned) it must live for at least `'a`. But
260260
/// it would also contain various points from within the function.
261-
#[derive(Clone)]
262261
pub(crate) struct RegionValues<N: Idx> {
263262
elements: Rc<DenseLocationMap>,
264-
placeholder_indices: Rc<PlaceholderIndices>,
263+
placeholder_indices: PlaceholderIndices,
265264
points: SparseIntervalMatrix<N, PointIndex>,
266265
free_regions: SparseBitMatrix<N, RegionVid>,
267266

@@ -277,7 +276,7 @@ impl<N: Idx> RegionValues<N> {
277276
pub(crate) fn new(
278277
elements: Rc<DenseLocationMap>,
279278
num_universal_regions: usize,
280-
placeholder_indices: Rc<PlaceholderIndices>,
279+
placeholder_indices: PlaceholderIndices,
281280
) -> Self {
282281
let num_points = elements.num_points();
283282
let num_placeholders = placeholder_indices.len();

0 commit comments

Comments
 (0)