Skip to content

Commit b913df0

Browse files
committed
remove num_universal_regions etc from RegionValueElements
1 parent 2584216 commit b913df0

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/librustc_mir/borrow_check/nll/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub(in borrow_check) fn compute_regions<'cx, 'gcx, 'tcx>(
104104
None
105105
};
106106

107-
let elements = &Rc::new(RegionValueElements::new(mir, universal_regions.len()));
107+
let elements = &Rc::new(RegionValueElements::new(mir));
108108

109109
// Run the MIR type-checker.
110110
let liveness_map = NllLivenessMap::compute(&mir);

src/librustc_mir/borrow_check/nll/region_infer/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
214214
let constraint_graph = Rc::new(constraints.graph(definitions.len()));
215215
let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph));
216216

217-
let mut scc_values = RegionValues::new(elements);
217+
let mut scc_values = RegionValues::new(
218+
elements,
219+
universal_regions.len(),
220+
);
218221

219222
for region in liveness_constraints.rows() {
220223
let scc = constraint_sccs.scc(region);

src/librustc_mir/borrow_check/nll/region_infer/values.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ crate struct RegionValueElements {
2222
/// For each basic block, how many points are contained within?
2323
statements_before_block: IndexVec<BasicBlock, usize>,
2424
num_points: usize,
25-
num_universal_regions: usize,
2625
}
2726

2827
impl RegionValueElements {
29-
crate fn new(mir: &Mir<'_>, num_universal_regions: usize) -> Self {
28+
crate fn new(mir: &Mir<'_>) -> Self {
3029
let mut num_points = 0;
3130
let statements_before_block = mir
3231
.basic_blocks()
@@ -37,11 +36,6 @@ impl RegionValueElements {
3736
v
3837
})
3938
.collect();
40-
41-
debug!(
42-
"RegionValueElements(num_universal_regions={:?})",
43-
num_universal_regions
44-
);
4539
debug!(
4640
"RegionValueElements: statements_before_block={:#?}",
4741
statements_before_block
@@ -51,7 +45,6 @@ impl RegionValueElements {
5145
Self {
5246
statements_before_block,
5347
num_points,
54-
num_universal_regions,
5548
}
5649
}
5750

@@ -191,11 +184,14 @@ impl<N: Idx> RegionValues<N> {
191184
/// Creates a new set of "region values" that tracks causal information.
192185
/// Each of the regions in num_region_variables will be initialized with an
193186
/// empty set of points and no causal information.
194-
crate fn new(elements: &Rc<RegionValueElements>) -> Self {
187+
crate fn new(
188+
elements: &Rc<RegionValueElements>,
189+
num_universal_regions: usize,
190+
) -> Self {
195191
Self {
196192
elements: elements.clone(),
197193
points: SparseBitMatrix::new(elements.num_points),
198-
free_regions: SparseBitMatrix::new(elements.num_universal_regions),
194+
free_regions: SparseBitMatrix::new(num_universal_regions),
199195
}
200196
}
201197

0 commit comments

Comments
 (0)