Skip to content

Commit 7a8f83a

Browse files
committed
Clean up patch
1 parent 9faae6a commit 7a8f83a

File tree

6 files changed

+14
-33
lines changed

6 files changed

+14
-33
lines changed

src/librustc/middle/infer/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,16 +1386,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13861386
.subst(self.tcx, substs);
13871387

13881388
if self.normalize {
1389-
// NOTE: this flag is currently *always* set to false, we are slowly folding
1390-
// normalization into this trait and will come back to remove this in the near
1391-
// future.
1392-
1393-
// code from NormalizingClosureTyper:
1394-
// the substitutions in `substs` are already monomorphized,
1395-
// but we still must normalize associated types
1396-
// normalize_associated_type(self.param_env.tcx, &closure_ty)
13971389
normalize_associated_type(&self.tcx, &closure_ty)
1398-
// panic!("see issue 26597: fufillment context refactor must occur")
13991390
} else {
14001391
closure_ty
14011392
}
@@ -1409,15 +1400,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14091400
let result = ty::ctxt::closure_upvars(self, def_id, substs);
14101401

14111402
if self.normalize {
1412-
// NOTE: this flag is currently *always* set to false, we are slowly folding
1413-
// normalization into this trait and will come back to remove this in the near
1414-
// future.
1415-
1416-
// code from NormalizingClosureTyper:
1417-
// the substitutions in `substs` are already monomorphized,
1418-
// but we still must normalize associated types
1419-
// monomorphize::normalize_associated_type(self.param_env.tcx, &result)
1420-
// panic!("see issue 26597: fufillment context refactor must occur")
14211403
normalize_associated_type(&self.tcx, &result)
14221404
} else {
14231405
result

src/librustc/middle/mem_categorization.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ impl ast_node for ast::Pat {
257257
#[derive(Copy, Clone)]
258258
pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
259259
pub typer: &'t infer::InferCtxt<'a, 'tcx>,
260-
// pub monomorphize: bool,
261260
}
262261

263262
pub type McResult<T> = Result<T, ()>;

src/librustc/middle/traits/mod.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,17 +436,20 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
436436
debug!("normalize_param_env(value={:?})", value);
437437

438438
let mut selcx = &mut SelectionContext::new(infcx);
439-
// FIXME (@jroesch): I'm not sure if this is a bug or not, needs
440-
// further investigation. It appears that by reusing the fulfillment_cx
441-
// here we incur more obligations and later trip an asssertion on
442-
// regionck.rs line 337. The two possibilities I see is that
443-
// normalization is not actually fully happening and we
444-
// have a bug else where or that we are adding a duplicate
445-
// bound into the list causing its size to change. I think
446-
// we should probably land this refactor and then come
439+
// FIXME (@jroesch):
440+
// I'm not sure if this is a bug or not, needs further investigation.
441+
// It appears that by reusing the fulfillment_cx here we incur more
442+
// obligations and later trip an asssertion on regionck.rs line 337.
443+
//
444+
// The two possibilities I see is:
445+
// - normalization is not actually fully happening and we
446+
// have a bug else where
447+
// - we are adding a duplicate bound into the list causing
448+
// its size to change.
449+
//
450+
// I think we should probably land this refactor and then come
447451
// back to this is a follow-up patch.
448452
let mut fulfill_cx = FulfillmentContext::new(false);
449-
// let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
450453

451454
let Normalized { value: normalized_value, obligations } =
452455
project::normalize(selcx, cause, value);
@@ -456,6 +459,7 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
456459
for obligation in obligations {
457460
fulfill_cx.register_predicate_obligation(selcx.infcx(), obligation);
458461
}
462+
459463
try!(fulfill_cx.select_all_or_error(infcx));
460464
let resolved_value = infcx.resolve_type_vars_if_possible(&normalized_value);
461465
debug!("normalize_param_env: resolved_value={:?}", resolved_value);

src/librustc_typeck/check/assoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use middle::ty_fold::TypeFoldable;
1616
use syntax::ast;
1717
use syntax::codemap::Span;
1818

19-
//FIME(@jroesch): Refactor this
19+
//FIXME(@jroesch): Ideally we should be able to drop the fulfillment_cx argument.
2020
pub fn normalize_associated_types_in<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
2121
fulfillment_cx: &mut FulfillmentContext<'tcx>,
2222
span: Span,

src/librustc_typeck/check/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ pub struct Inherited<'a, 'tcx: 'a> {
158158
// one is never copied into the tcx: it is only used by regionck.
159159
fn_sig_map: RefCell<NodeMap<Vec<Ty<'tcx>>>>,
160160

161-
// Tracks trait obligations incurred during this function body.
162-
// fulfillment_cx: RefCell<traits::FulfillmentContext<'tcx>>,
163-
164161
// When we process a call like `c()` where `c` is a closure type,
165162
// we may not have decided yet whether `c` is a `Fn`, `FnMut`, or
166163
// `FnOnce` closure. In that case, we defer full resolution of the

src/librustc_typeck/coherence/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ fn subst_receiver_types_in_method_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
631631
pub fn check_coherence(crate_context: &CrateCtxt) {
632632
CoherenceChecker {
633633
crate_context: crate_context,
634-
// XXXJAREDXXX: not sure if the bool is right here?
635634
inference_context: new_infer_ctxt(crate_context.tcx, &crate_context.tcx.tables, None, true),
636635
inherent_impls: RefCell::new(FnvHashMap()),
637636
}.check(crate_context.tcx.map.krate());

0 commit comments

Comments
 (0)