@@ -1338,7 +1338,9 @@ pub struct UniverseIndex(u32);
1338
1338
impl UniverseIndex {
1339
1339
/// The root universe, where things that the user defined are
1340
1340
/// visible.
1341
- pub const ROOT : UniverseIndex = UniverseIndex ( 0 ) ;
1341
+ pub fn root ( ) -> UniverseIndex {
1342
+ UniverseIndex ( 0 )
1343
+ }
1342
1344
1343
1345
/// A "subuniverse" corresponds to being inside a `forall` quantifier.
1344
1346
/// So, for example, suppose we have this type in universe `U`:
@@ -1354,13 +1356,6 @@ impl UniverseIndex {
1354
1356
pub fn subuniverse ( self ) -> UniverseIndex {
1355
1357
UniverseIndex ( self . 0 + 1 )
1356
1358
}
1357
-
1358
- /// Gets the "depth" of this universe in the universe tree. This
1359
- /// is not really useful except for e.g. the `HashStable`
1360
- /// implementation
1361
- pub fn depth ( & self ) -> u32 {
1362
- self . 0
1363
- }
1364
1359
}
1365
1360
1366
1361
/// When type checking, we use the `ParamEnv` to track
@@ -1377,17 +1372,6 @@ pub struct ParamEnv<'tcx> {
1377
1372
/// want `Reveal::All` -- note that this is always paired with an
1378
1373
/// empty environment. To get that, use `ParamEnv::reveal()`.
1379
1374
pub reveal : traits:: Reveal ,
1380
-
1381
- /// What is the innermost universe we have created? Starts out as
1382
- /// `UniverseIndex::root()` but grows from there as we enter
1383
- /// universal quantifiers.
1384
- ///
1385
- /// NB: At present, we exclude the universal quantifiers on the
1386
- /// item we are type-checking, and just consider those names as
1387
- /// part of the root universe. So this would only get incremented
1388
- /// when we enter into a higher-ranked (`for<..>`) type or trait
1389
- /// bound.
1390
- pub universe : UniverseIndex ,
1391
1375
}
1392
1376
1393
1377
impl < ' tcx > ParamEnv < ' tcx > {
@@ -2707,8 +2691,7 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
2707
2691
// sure that this will succeed without errors anyway.
2708
2692
2709
2693
let unnormalized_env = ty:: ParamEnv :: new ( tcx. intern_predicates ( & predicates) ,
2710
- traits:: Reveal :: UserFacing ,
2711
- ty:: UniverseIndex :: ROOT ) ;
2694
+ traits:: Reveal :: UserFacing ) ;
2712
2695
2713
2696
let body_id = tcx. hir . as_local_node_id ( def_id) . map_or ( DUMMY_NODE_ID , |id| {
2714
2697
tcx. hir . maybe_body_owned_by ( id) . map_or ( id, |body| body. node_id )
0 commit comments