@@ -161,7 +161,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
161161 // For region variables.
162162 region_vars : RegionVarBindings < ' a , ' gcx , ' tcx > ,
163163
164- pub parameter_environment : ty:: ParameterEnvironment < ' gcx > ,
164+ pub param_env : ty:: ParamEnv < ' gcx > ,
165165
166166 /// Caches the results of trait selection. This cache is used
167167 /// for things that have to do with the parameters in scope.
@@ -406,41 +406,41 @@ pub trait InferEnv<'a, 'tcx> {
406406 fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
407407 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
408408 Option < ty:: TypeckTables < ' tcx > > ,
409- Option < ty:: ParameterEnvironment < ' tcx > > ) ;
409+ Option < ty:: ParamEnv < ' tcx > > ) ;
410410}
411411
412412impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ) {
413413 fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
414414 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
415415 Option < ty:: TypeckTables < ' tcx > > ,
416- Option < ty:: ParameterEnvironment < ' tcx > > ) {
416+ Option < ty:: ParamEnv < ' tcx > > ) {
417417 ( None , None , None )
418418 }
419419}
420420
421- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ty:: ParameterEnvironment < ' tcx > {
421+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ty:: ParamEnv < ' tcx > {
422422 fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
423423 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
424424 Option < ty:: TypeckTables < ' tcx > > ,
425- Option < ty:: ParameterEnvironment < ' tcx > > ) {
425+ Option < ty:: ParamEnv < ' tcx > > ) {
426426 ( None , None , Some ( self ) )
427427 }
428428}
429429
430- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( & ' a ty:: TypeckTables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
430+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( & ' a ty:: TypeckTables < ' tcx > , ty:: ParamEnv < ' tcx > ) {
431431 fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
432432 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
433433 Option < ty:: TypeckTables < ' tcx > > ,
434- Option < ty:: ParameterEnvironment < ' tcx > > ) {
434+ Option < ty:: ParamEnv < ' tcx > > ) {
435435 ( Some ( self . 0 ) , None , Some ( self . 1 ) )
436436 }
437437}
438438
439- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ty:: TypeckTables < ' tcx > , ty:: ParameterEnvironment < ' tcx > ) {
439+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ty:: TypeckTables < ' tcx > , ty:: ParamEnv < ' tcx > ) {
440440 fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
441441 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
442442 Option < ty:: TypeckTables < ' tcx > > ,
443- Option < ty:: ParameterEnvironment < ' tcx > > ) {
443+ Option < ty:: ParamEnv < ' tcx > > ) {
444444 ( None , Some ( self . 0 ) , Some ( self . 1 ) )
445445 }
446446}
@@ -449,11 +449,11 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
449449 fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
450450 -> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
451451 Option < ty:: TypeckTables < ' tcx > > ,
452- Option < ty:: ParameterEnvironment < ' tcx > > ) {
452+ Option < ty:: ParamEnv < ' tcx > > ) {
453453 let def_id = tcx. hir . body_owner_def_id ( self ) ;
454454 ( Some ( tcx. typeck_tables_of ( def_id) ) ,
455455 None ,
456- Some ( tcx. parameter_environment ( def_id) ) )
456+ Some ( tcx. param_env ( def_id) ) )
457457 }
458458}
459459
@@ -465,7 +465,7 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
465465 arena : DroplessArena ,
466466 fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
467467 tables : Option < & ' a ty:: TypeckTables < ' gcx > > ,
468- param_env : Option < ty:: ParameterEnvironment < ' gcx > > ,
468+ param_env : Option < ty:: ParamEnv < ' gcx > > ,
469469 projection_mode : Reveal ,
470470}
471471
@@ -498,7 +498,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
498498 int_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
499499 float_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
500500 region_vars : RegionVarBindings :: new ( self ) ,
501- parameter_environment : param_env. unwrap ( ) ,
501+ param_env : param_env. unwrap ( ) ,
502502 selection_cache : traits:: SelectionCache :: new ( ) ,
503503 evaluation_cache : traits:: EvaluationCache :: new ( ) ,
504504 projection_cache : RefCell :: new ( traits:: ProjectionCache :: new ( ) ) ,
@@ -526,9 +526,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
526526 let tables = tables. map ( InferTables :: Interned ) . unwrap_or_else ( || {
527527 fresh_tables. as_ref ( ) . map_or ( InferTables :: Missing , InferTables :: InProgress )
528528 } ) ;
529- let param_env = param_env. take ( ) . unwrap_or_else ( || {
530- global_tcx. empty_parameter_environment ( )
531- } ) ;
529+ let param_env = param_env. take ( ) . unwrap_or_else ( || ty:: ParamEnv :: empty ( ) ) ;
532530 global_tcx. enter_local ( arena, |tcx| f ( InferCtxt {
533531 tcx : tcx,
534532 tables : tables,
@@ -537,7 +535,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
537535 int_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
538536 float_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
539537 region_vars : RegionVarBindings :: new ( tcx) ,
540- parameter_environment : param_env,
538+ param_env : param_env,
541539 selection_cache : traits:: SelectionCache :: new ( ) ,
542540 evaluation_cache : traits:: EvaluationCache :: new ( ) ,
543541 reported_trait_errors : RefCell :: new ( FxHashSet ( ) ) ,
@@ -650,7 +648,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
650648 }
651649
652650 pub fn normalize_associated_type_in_env < T > (
653- self , value : & T , env : & ' a ty:: ParameterEnvironment < ' tcx >
651+ self , value : & T , env : ty:: ParamEnv < ' tcx >
654652 ) -> T
655653 where T : TransNormalize < ' tcx >
656654 {
@@ -662,7 +660,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
662660 return value;
663661 }
664662
665- self . infer_ctxt ( env. clone ( ) , Reveal :: All ) . enter ( |infcx| {
663+ self . infer_ctxt ( env, Reveal :: All ) . enter ( |infcx| {
666664 value. trans_normalize ( & infcx)
667665 } )
668666 }
@@ -1674,8 +1672,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16741672 self . tables . borrow ( ) . upvar_capture_map . get ( & upvar_id) . cloned ( )
16751673 }
16761674
1677- pub fn param_env ( & self ) -> & ty:: ParameterEnvironment < ' gcx > {
1678- & self . parameter_environment
1675+ pub fn param_env ( & self ) -> ty:: ParamEnv < ' gcx > {
1676+ self . param_env
16791677 }
16801678
16811679 pub fn closure_kind ( & self ,
0 commit comments