@@ -27,10 +27,6 @@ pub(crate) enum RegionElement {
27
27
/// A universally quantified region from the root universe (e.g.,
28
28
/// a lifetime parameter).
29
29
RootUniversalRegion ( RegionVid ) ,
30
-
31
- /// A placeholder (e.g., instantiated from a `for<'a> fn(&'a u32)`
32
- /// type).
33
- PlaceholderRegion ( ty:: PlaceholderRegion ) ,
34
30
}
35
31
36
32
/// Records the CFG locations where each region is live. When we initially compute liveness, we use
@@ -226,21 +222,6 @@ impl PlaceholderIndices {
226
222
let ( index, _) = self . indices . insert_full ( placeholder) ;
227
223
index. into ( )
228
224
}
229
-
230
- pub ( crate ) fn lookup_index ( & self , placeholder : ty:: PlaceholderRegion ) -> PlaceholderIndex {
231
- self . indices . get_index_of ( & placeholder) . unwrap ( ) . into ( )
232
- }
233
-
234
- pub ( crate ) fn lookup_placeholder (
235
- & self ,
236
- placeholder : PlaceholderIndex ,
237
- ) -> ty:: PlaceholderRegion {
238
- self . indices [ placeholder. index ( ) ]
239
- }
240
-
241
- pub ( crate ) fn len ( & self ) -> usize {
242
- self . indices . len ( )
243
- }
244
225
}
245
226
246
227
/// Stores the full values for a set of regions (in contrast to
@@ -264,31 +245,19 @@ impl PlaceholderIndices {
264
245
#[ derive( Clone ) ]
265
246
pub ( crate ) struct RegionValues < N : Idx > {
266
247
elements : Rc < DenseLocationMap > ,
267
- placeholder_indices : Rc < PlaceholderIndices > ,
268
248
points : SparseIntervalMatrix < N , PointIndex > ,
269
249
free_regions : SparseBitMatrix < N , RegionVid > ,
270
-
271
- /// Placeholders represent bound regions -- so something like `'a`
272
- /// in `for<'a> fn(&'a u32)`.
273
- placeholders : SparseBitMatrix < N , PlaceholderIndex > ,
274
250
}
275
251
276
252
impl < N : Idx > RegionValues < N > {
277
253
/// Creates a new set of "region values" that tracks causal information.
278
254
/// Each of the regions in num_region_variables will be initialized with an
279
255
/// empty set of points and no causal information.
280
- pub ( crate ) fn new (
281
- elements : & Rc < DenseLocationMap > ,
282
- num_universal_regions : usize ,
283
- placeholder_indices : & Rc < PlaceholderIndices > ,
284
- ) -> Self {
285
- let num_placeholders = placeholder_indices. len ( ) ;
256
+ pub ( crate ) fn new ( elements : & Rc < DenseLocationMap > , num_universal_regions : usize ) -> Self {
286
257
Self {
287
258
elements : elements. clone ( ) ,
288
259
points : SparseIntervalMatrix :: new ( elements. num_points ( ) ) ,
289
- placeholder_indices : placeholder_indices. clone ( ) ,
290
260
free_regions : SparseBitMatrix :: new ( num_universal_regions) ,
291
- placeholders : SparseBitMatrix :: new ( num_placeholders) ,
292
261
}
293
262
}
294
263
@@ -307,9 +276,7 @@ impl<N: Idx> RegionValues<N> {
307
276
/// Adds all elements in `r_from` to `r_to` (because e.g., `r_to:
308
277
/// r_from`).
309
278
pub ( crate ) fn add_region ( & mut self , r_to : N , r_from : N ) -> bool {
310
- self . points . union_rows ( r_from, r_to)
311
- | self . free_regions . union_rows ( r_from, r_to)
312
- | self . placeholders . union_rows ( r_from, r_to)
279
+ self . points . union_rows ( r_from, r_to) | self . free_regions . union_rows ( r_from, r_to)
313
280
}
314
281
315
282
/// Returns `true` if the region `r` contains the given element.
@@ -378,18 +345,6 @@ impl<N: Idx> RegionValues<N> {
378
345
self . free_regions . row ( r) . into_iter ( ) . flat_map ( |set| set. iter ( ) )
379
346
}
380
347
381
- /// Returns all the elements contained in a given region's value.
382
- pub ( crate ) fn placeholders_contained_in < ' a > (
383
- & ' a self ,
384
- r : N ,
385
- ) -> impl Iterator < Item = ty:: PlaceholderRegion > + ' a {
386
- self . placeholders
387
- . row ( r)
388
- . into_iter ( )
389
- . flat_map ( |set| set. iter ( ) )
390
- . map ( move |p| self . placeholder_indices . lookup_placeholder ( p) )
391
- }
392
-
393
348
/// Returns all the elements contained in a given region's value.
394
349
pub ( crate ) fn elements_contained_in < ' a > (
395
350
& ' a self ,
@@ -400,10 +355,7 @@ impl<N: Idx> RegionValues<N> {
400
355
let free_regions_iter =
401
356
self . universal_regions_outlived_by ( r) . map ( RegionElement :: RootUniversalRegion ) ;
402
357
403
- let placeholder_universes_iter =
404
- self . placeholders_contained_in ( r) . map ( RegionElement :: PlaceholderRegion ) ;
405
-
406
- points_iter. chain ( free_regions_iter) . chain ( placeholder_universes_iter)
358
+ points_iter. chain ( free_regions_iter)
407
359
}
408
360
409
361
/// Returns a "pretty" string value of the region. Meant for debugging.
@@ -440,18 +392,6 @@ impl ToElementIndex for RegionVid {
440
392
}
441
393
}
442
394
443
- impl ToElementIndex for ty:: PlaceholderRegion {
444
- fn add_to_row < N : Idx > ( self , values : & mut RegionValues < N > , row : N ) -> bool {
445
- let index = values. placeholder_indices . lookup_index ( self ) ;
446
- values. placeholders . insert ( row, index)
447
- }
448
-
449
- fn contained_in_row < N : Idx > ( self , values : & RegionValues < N > , row : N ) -> bool {
450
- let index = values. placeholder_indices . lookup_index ( self ) ;
451
- values. placeholders . contains ( row, index)
452
- }
453
- }
454
-
455
395
/// For debugging purposes, returns a pretty-printed string of the given points.
456
396
pub ( crate ) fn pretty_print_points (
457
397
elements : & DenseLocationMap ,
@@ -511,17 +451,6 @@ fn pretty_print_region_elements(elements: impl IntoIterator<Item = RegionElement
511
451
push_sep ( & mut result) ;
512
452
result. push_str ( & format ! ( "{fr:?}" ) ) ;
513
453
}
514
-
515
- RegionElement :: PlaceholderRegion ( placeholder) => {
516
- if let Some ( ( location1, location2) ) = open_location {
517
- push_sep ( & mut result) ;
518
- push_location_range ( & mut result, location1, location2) ;
519
- open_location = None ;
520
- }
521
-
522
- push_sep ( & mut result) ;
523
- result. push_str ( & format ! ( "{placeholder:?}" ) ) ;
524
- }
525
454
}
526
455
}
527
456
0 commit comments