@@ -136,13 +136,6 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
136
136
// avoid reporting the same error twice.
137
137
pub reported_trait_errors : RefCell < FnvHashSet < traits:: TraitErrorKey < ' tcx > > > ,
138
138
139
- // This is a temporary field used for toggling on normalization in the inference context,
140
- // as we move towards the approach described here:
141
- // https://internals.rust-lang.org/t/flattening-the-contexts-for-fun-and-profit/2293
142
- // At a point sometime in the future normalization will be done by the typing context
143
- // directly.
144
- normalize : bool ,
145
-
146
139
// Sadly, the behavior of projection varies a bit depending on the
147
140
// stage of compilation. The specifics are given in the
148
141
// documentation for `Reveal`.
@@ -458,7 +451,6 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
458
451
tables : Option < RefCell < ty:: Tables < ' tcx > > > ,
459
452
param_env : Option < ty:: ParameterEnvironment < ' gcx > > ,
460
453
projection_mode : Reveal ,
461
- normalize : bool
462
454
}
463
455
464
456
impl < ' a , ' gcx , ' tcx > TyCtxt < ' a , ' gcx , ' gcx > {
@@ -473,7 +465,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
473
465
tables : tables. map ( RefCell :: new) ,
474
466
param_env : param_env,
475
467
projection_mode : projection_mode,
476
- normalize : false
477
468
}
478
469
}
479
470
@@ -485,7 +476,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
485
476
tables : None ,
486
477
param_env : None ,
487
478
projection_mode : projection_mode,
488
- normalize : false
489
479
}
490
480
}
491
481
@@ -506,7 +496,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
506
496
evaluation_cache : traits:: EvaluationCache :: new ( ) ,
507
497
projection_cache : RefCell :: new ( traits:: ProjectionCache :: new ( ) ) ,
508
498
reported_trait_errors : RefCell :: new ( FnvHashSet ( ) ) ,
509
- normalize : false ,
510
499
projection_mode : Reveal :: NotSpecializable ,
511
500
tainted_by_errors_flag : Cell :: new ( false ) ,
512
501
err_count_on_creation : self . sess . err_count ( ) ,
@@ -525,7 +514,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
525
514
ref tables,
526
515
ref mut param_env,
527
516
projection_mode,
528
- normalize
529
517
} = * self ;
530
518
let tables = if let Some ( ref tables) = * tables {
531
519
InferTables :: Local ( tables)
@@ -547,7 +535,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
547
535
selection_cache : traits:: SelectionCache :: new ( ) ,
548
536
evaluation_cache : traits:: EvaluationCache :: new ( ) ,
549
537
reported_trait_errors : RefCell :: new ( FnvHashSet ( ) ) ,
550
- normalize : normalize,
551
538
projection_mode : projection_mode,
552
539
tainted_by_errors_flag : Cell :: new ( false ) ,
553
540
err_count_on_creation : tcx. sess . err_count ( ) ,
@@ -1702,17 +1689,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1702
1689
}
1703
1690
1704
1691
let closure_ty = self . tcx . closure_type ( def_id, substs) ;
1705
- if self . normalize {
1706
- let closure_ty = self . tcx . erase_regions ( & closure_ty) ;
1707
-
1708
- if !closure_ty. has_projection_types ( ) {
1709
- return closure_ty;
1710
- }
1711
-
1712
- self . normalize_projections_in ( & closure_ty)
1713
- } else {
1714
- closure_ty
1715
- }
1692
+ closure_ty
1716
1693
}
1717
1694
}
1718
1695
0 commit comments