Skip to content

Commit 52c2d87

Browse files
committed
remove unused normalize field
1 parent 824000a commit 52c2d87

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/librustc/infer/mod.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
136136
// avoid reporting the same error twice.
137137
pub reported_trait_errors: RefCell<FnvHashSet<traits::TraitErrorKey<'tcx>>>,
138138

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-
146139
// Sadly, the behavior of projection varies a bit depending on the
147140
// stage of compilation. The specifics are given in the
148141
// documentation for `Reveal`.
@@ -458,7 +451,6 @@ pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
458451
tables: Option<RefCell<ty::Tables<'tcx>>>,
459452
param_env: Option<ty::ParameterEnvironment<'gcx>>,
460453
projection_mode: Reveal,
461-
normalize: bool
462454
}
463455

464456
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
@@ -473,7 +465,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
473465
tables: tables.map(RefCell::new),
474466
param_env: param_env,
475467
projection_mode: projection_mode,
476-
normalize: false
477468
}
478469
}
479470

@@ -485,7 +476,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
485476
tables: None,
486477
param_env: None,
487478
projection_mode: projection_mode,
488-
normalize: false
489479
}
490480
}
491481

@@ -506,7 +496,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
506496
evaluation_cache: traits::EvaluationCache::new(),
507497
projection_cache: RefCell::new(traits::ProjectionCache::new()),
508498
reported_trait_errors: RefCell::new(FnvHashSet()),
509-
normalize: false,
510499
projection_mode: Reveal::NotSpecializable,
511500
tainted_by_errors_flag: Cell::new(false),
512501
err_count_on_creation: self.sess.err_count(),
@@ -525,7 +514,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
525514
ref tables,
526515
ref mut param_env,
527516
projection_mode,
528-
normalize
529517
} = *self;
530518
let tables = if let Some(ref tables) = *tables {
531519
InferTables::Local(tables)
@@ -547,7 +535,6 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
547535
selection_cache: traits::SelectionCache::new(),
548536
evaluation_cache: traits::EvaluationCache::new(),
549537
reported_trait_errors: RefCell::new(FnvHashSet()),
550-
normalize: normalize,
551538
projection_mode: projection_mode,
552539
tainted_by_errors_flag: Cell::new(false),
553540
err_count_on_creation: tcx.sess.err_count(),
@@ -1702,17 +1689,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
17021689
}
17031690

17041691
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
17161693
}
17171694
}
17181695

0 commit comments

Comments
 (0)