]> git.lizzy.rs Git - rust.git/commitdiff
Clean up patch
authorJared Roesch <roeschinc@gmail.com>
Tue, 30 Jun 2015 09:39:47 +0000 (02:39 -0700)
committerJared Roesch <roeschinc@gmail.com>
Tue, 30 Jun 2015 09:41:40 +0000 (02:41 -0700)
src/librustc/middle/infer/mod.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/traits/mod.rs
src/librustc_typeck/check/assoc.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/coherence/mod.rs

index a64fe8b91282b86bee58397a08321c22d7430258..43be1beba91d04f02cf918f1b2a03b6e462532dc 100644 (file)
@@ -1386,16 +1386,7 @@ pub fn closure_type(&self,
                              .subst(self.tcx, substs);
 
         if self.normalize {
-            // NOTE: this flag is currently *always* set to false, we are slowly folding
-            // normalization into this trait and will come back to remove this in the near
-            // future.
-
-            // code from NormalizingClosureTyper:
-            // the substitutions in `substs` are already monomorphized,
-            // but we still must normalize associated types
-            // normalize_associated_type(self.param_env.tcx, &closure_ty)
             normalize_associated_type(&self.tcx, &closure_ty)
-            // panic!("see issue 26597: fufillment context refactor must occur")
         } else {
             closure_ty
         }
@@ -1409,15 +1400,6 @@ pub fn closure_upvars(&self,
         let result = ty::ctxt::closure_upvars(self, def_id, substs);
 
         if self.normalize {
-            // NOTE: this flag is currently *always* set to false, we are slowly folding
-            // normalization into this trait and will come back to remove this in the near
-            // future.
-
-            // code from NormalizingClosureTyper:
-            // the substitutions in `substs` are already monomorphized,
-            // but we still must normalize associated types
-            // monomorphize::normalize_associated_type(self.param_env.tcx, &result)
-            // panic!("see issue 26597: fufillment context refactor must occur")
             normalize_associated_type(&self.tcx, &result)
         } else {
             result
index 32fbd7739005ea36f5326c331d6777a4f3d200a0..f506de525ff9c644e1761e460ab52c21cd04fc71 100644 (file)
@@ -257,7 +257,6 @@ fn span(&self) -> Span { self.span }
 #[derive(Copy, Clone)]
 pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
     pub typer: &'t infer::InferCtxt<'a, 'tcx>,
-    // pub monomorphize: bool,
 }
 
 pub type McResult<T> = Result<T, ()>;
index a39fe453664360aff5c7f9963183d51c4b549bfe..47002497acca5c1d20dbda361f9597c24ff0b662 100644 (file)
@@ -436,17 +436,20 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
     debug!("normalize_param_env(value={:?})", value);
 
     let mut selcx = &mut SelectionContext::new(infcx);
-    // FIXME (@jroesch): I'm not sure if this is a bug or not, needs
-    // further investigation. It appears that by reusing the fulfillment_cx
-    // here we incur more obligations and later trip an asssertion on
-    // regionck.rs line 337. The two possibilities I see is that
-    // normalization is not actually fully happening and we
-    // have a bug else where or that we are adding a duplicate
-    // bound into the list causing its size to change. I think
-    // we should probably land this refactor and then come
+    // FIXME (@jroesch):
+    // I'm not sure if this is a bug or not, needs further investigation.
+    // It appears that by reusing the fulfillment_cx here we incur more
+    // obligations and later trip an asssertion on regionck.rs line 337.
+    //
+    // The two possibilities I see is:
+    //      - normalization is not actually fully happening and we
+    //        have a bug else where
+    //      - we are adding a duplicate bound into the list causing
+    //        its size to change.
+    //
+    // I think we should probably land this refactor and then come
     // back to this is a follow-up patch.
     let mut fulfill_cx = FulfillmentContext::new(false);
-    // let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
 
     let Normalized { value: normalized_value, obligations } =
         project::normalize(selcx, cause, value);
@@ -456,6 +459,7 @@ pub fn fully_normalize<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
     for obligation in obligations {
         fulfill_cx.register_predicate_obligation(selcx.infcx(), obligation);
     }
+    
     try!(fulfill_cx.select_all_or_error(infcx));
     let resolved_value = infcx.resolve_type_vars_if_possible(&normalized_value);
     debug!("normalize_param_env: resolved_value={:?}", resolved_value);
index 75263c35d595822f33562b7fe6613ef8071d2b90..c80c48a96922dd7dd3c63df3b705918a86dcc1d6 100644 (file)
@@ -16,7 +16,7 @@
 use syntax::ast;
 use syntax::codemap::Span;
 
-//FIME(@jroesch): Refactor this
+//FIXME(@jroesch): Ideally we should be able to drop the fulfillment_cx argument.
 pub fn normalize_associated_types_in<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
                                                 fulfillment_cx: &mut FulfillmentContext<'tcx>,
                                                 span: Span,
index 477b6e9825689e3dd21a6fcca0eb17af2dad211d..b7ebf1abd2d22cee14abdba13d66f87d49649f29 100644 (file)
@@ -158,9 +158,6 @@ pub struct Inherited<'a, 'tcx: 'a> {
     // one is never copied into the tcx: it is only used by regionck.
     fn_sig_map: RefCell<NodeMap<Vec<Ty<'tcx>>>>,
 
-    // Tracks trait obligations incurred during this function body.
-    // fulfillment_cx: RefCell<traits::FulfillmentContext<'tcx>>,
-
     // When we process a call like `c()` where `c` is a closure type,
     // we may not have decided yet whether `c` is a `Fn`, `FnMut`, or
     // `FnOnce` closure. In that case, we defer full resolution of the
index fca23a1b029a863343802e644eda80893007705c..a1c5ad51dcdf74989e117be321c101e166e31e83 100644 (file)
@@ -631,7 +631,6 @@ fn subst_receiver_types_in_method_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
 pub fn check_coherence(crate_context: &CrateCtxt) {
     CoherenceChecker {
         crate_context: crate_context,
-        // XXXJAREDXXX: not sure if the bool is right here?
         inference_context: new_infer_ctxt(crate_context.tcx, &crate_context.tcx.tables, None, true),
         inherent_impls: RefCell::new(FnvHashMap()),
     }.check(crate_context.tcx.map.krate());