@@ -1338,7 +1338,9 @@ pub struct UniverseIndex(u32);
13381338impl UniverseIndex {
13391339 /// The root universe, where things that the user defined are
13401340 /// visible.
1341- pub const ROOT : UniverseIndex = UniverseIndex ( 0 ) ;
1341+ pub fn root ( ) -> UniverseIndex {
1342+ UniverseIndex ( 0 )
1343+ }
13421344
13431345 /// A "subuniverse" corresponds to being inside a `forall` quantifier.
13441346 /// So, for example, suppose we have this type in universe `U`:
@@ -1354,13 +1356,6 @@ impl UniverseIndex {
13541356 pub fn subuniverse ( self ) -> UniverseIndex {
13551357 UniverseIndex ( self . 0 + 1 )
13561358 }
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- }
13641359}
13651360
13661361/// When type checking, we use the `ParamEnv` to track
@@ -1377,17 +1372,6 @@ pub struct ParamEnv<'tcx> {
13771372 /// want `Reveal::All` -- note that this is always paired with an
13781373 /// empty environment. To get that, use `ParamEnv::reveal()`.
13791374 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 ,
13911375}
13921376
13931377impl < ' tcx > ParamEnv < ' tcx > {
@@ -2707,8 +2691,7 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
27072691 // sure that this will succeed without errors anyway.
27082692
27092693 let unnormalized_env = ty:: ParamEnv :: new ( tcx. intern_predicates ( & predicates) ,
2710- traits:: Reveal :: UserFacing ,
2711- ty:: UniverseIndex :: ROOT ) ;
2694+ traits:: Reveal :: UserFacing ) ;
27122695
27132696 let body_id = tcx. hir . as_local_node_id ( def_id) . map_or ( DUMMY_NODE_ID , |id| {
27142697 tcx. hir . maybe_body_owned_by ( id) . map_or ( id, |body| body. node_id )
0 commit comments