@@ -161,7 +161,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
161
161
// For region variables.
162
162
region_vars : RegionVarBindings < ' a , ' gcx , ' tcx > ,
163
163
164
- pub parameter_environment : ty:: ParameterEnvironment < ' gcx > ,
164
+ pub param_env : ty:: ParamEnv < ' gcx > ,
165
165
166
166
/// Caches the results of trait selection. This cache is used
167
167
/// for things that have to do with the parameters in scope.
@@ -406,41 +406,41 @@ pub trait InferEnv<'a, 'tcx> {
406
406
fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
407
407
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
408
408
Option < ty:: TypeckTables < ' tcx > > ,
409
- Option < ty:: ParameterEnvironment < ' tcx > > ) ;
409
+ Option < ty:: ParamEnv < ' tcx > > ) ;
410
410
}
411
411
412
412
impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ( ) {
413
413
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
414
414
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
415
415
Option < ty:: TypeckTables < ' tcx > > ,
416
- Option < ty:: ParameterEnvironment < ' tcx > > ) {
416
+ Option < ty:: ParamEnv < ' tcx > > ) {
417
417
( None , None , None )
418
418
}
419
419
}
420
420
421
- impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ty:: ParameterEnvironment < ' tcx > {
421
+ impl < ' a , ' tcx > InferEnv < ' a , ' tcx > for ty:: ParamEnv < ' tcx > {
422
422
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
423
423
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
424
424
Option < ty:: TypeckTables < ' tcx > > ,
425
- Option < ty:: ParameterEnvironment < ' tcx > > ) {
425
+ Option < ty:: ParamEnv < ' tcx > > ) {
426
426
( None , None , Some ( self ) )
427
427
}
428
428
}
429
429
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 > ) {
431
431
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
432
432
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
433
433
Option < ty:: TypeckTables < ' tcx > > ,
434
- Option < ty:: ParameterEnvironment < ' tcx > > ) {
434
+ Option < ty:: ParamEnv < ' tcx > > ) {
435
435
( Some ( self . 0 ) , None , Some ( self . 1 ) )
436
436
}
437
437
}
438
438
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 > ) {
440
440
fn to_parts ( self , _: TyCtxt < ' a , ' tcx , ' tcx > )
441
441
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
442
442
Option < ty:: TypeckTables < ' tcx > > ,
443
- Option < ty:: ParameterEnvironment < ' tcx > > ) {
443
+ Option < ty:: ParamEnv < ' tcx > > ) {
444
444
( None , Some ( self . 0 ) , Some ( self . 1 ) )
445
445
}
446
446
}
@@ -449,11 +449,11 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
449
449
fn to_parts ( self , tcx : TyCtxt < ' a , ' tcx , ' tcx > )
450
450
-> ( Option < & ' a ty:: TypeckTables < ' tcx > > ,
451
451
Option < ty:: TypeckTables < ' tcx > > ,
452
- Option < ty:: ParameterEnvironment < ' tcx > > ) {
452
+ Option < ty:: ParamEnv < ' tcx > > ) {
453
453
let def_id = tcx. hir . body_owner_def_id ( self ) ;
454
454
( Some ( tcx. typeck_tables_of ( def_id) ) ,
455
455
None ,
456
- Some ( tcx. parameter_environment ( def_id) ) )
456
+ Some ( tcx. param_env ( def_id) ) )
457
457
}
458
458
}
459
459
@@ -465,7 +465,7 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
465
465
arena : DroplessArena ,
466
466
fresh_tables : Option < RefCell < ty:: TypeckTables < ' tcx > > > ,
467
467
tables : Option < & ' a ty:: TypeckTables < ' gcx > > ,
468
- param_env : Option < ty:: ParameterEnvironment < ' gcx > > ,
468
+ param_env : Option < ty:: ParamEnv < ' gcx > > ,
469
469
projection_mode : Reveal ,
470
470
}
471
471
@@ -498,7 +498,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
498
498
int_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
499
499
float_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
500
500
region_vars : RegionVarBindings :: new ( self ) ,
501
- parameter_environment : param_env. unwrap ( ) ,
501
+ param_env : param_env. unwrap ( ) ,
502
502
selection_cache : traits:: SelectionCache :: new ( ) ,
503
503
evaluation_cache : traits:: EvaluationCache :: new ( ) ,
504
504
projection_cache : RefCell :: new ( traits:: ProjectionCache :: new ( ) ) ,
@@ -526,9 +526,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
526
526
let tables = tables. map ( InferTables :: Interned ) . unwrap_or_else ( || {
527
527
fresh_tables. as_ref ( ) . map_or ( InferTables :: Missing , InferTables :: InProgress )
528
528
} ) ;
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 ( ) ) ;
532
530
global_tcx. enter_local ( arena, |tcx| f ( InferCtxt {
533
531
tcx : tcx,
534
532
tables : tables,
@@ -537,7 +535,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
537
535
int_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
538
536
float_unification_table : RefCell :: new ( UnificationTable :: new ( ) ) ,
539
537
region_vars : RegionVarBindings :: new ( tcx) ,
540
- parameter_environment : param_env,
538
+ param_env : param_env,
541
539
selection_cache : traits:: SelectionCache :: new ( ) ,
542
540
evaluation_cache : traits:: EvaluationCache :: new ( ) ,
543
541
reported_trait_errors : RefCell :: new ( FxHashSet ( ) ) ,
@@ -650,7 +648,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
650
648
}
651
649
652
650
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 >
654
652
) -> T
655
653
where T : TransNormalize < ' tcx >
656
654
{
@@ -662,7 +660,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
662
660
return value;
663
661
}
664
662
665
- self . infer_ctxt ( env. clone ( ) , Reveal :: All ) . enter ( |infcx| {
663
+ self . infer_ctxt ( env, Reveal :: All ) . enter ( |infcx| {
666
664
value. trans_normalize ( & infcx)
667
665
} )
668
666
}
@@ -1674,8 +1672,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1674
1672
self . tables . borrow ( ) . upvar_capture_map . get ( & upvar_id) . cloned ( )
1675
1673
}
1676
1674
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
1679
1677
}
1680
1678
1681
1679
pub fn closure_kind ( & self ,
0 commit comments