]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/assoc.rs
Rollup merge of #27369 - brson:realstd, r=alexcrichton
[rust.git] / src / librustc_typeck / check / assoc.rs
index 334fe2f54c03c24275bbf9f2663f6905098c52f7..c80c48a96922dd7dd3c63df3b705918a86dcc1d6 100644 (file)
 use middle::infer::InferCtxt;
 use middle::traits::{self, FulfillmentContext, Normalized, MiscObligation,
                      SelectionContext, ObligationCause};
-use middle::ty::{self, HasProjectionTypes};
-use middle::ty_fold::{TypeFoldable, TypeFolder};
+use middle::ty::HasTypeFlags;
+use middle::ty_fold::TypeFoldable;
 use syntax::ast;
 use syntax::codemap::Span;
-use util::ppaux::Repr;
 
+//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>,
-                                                typer: &(ty::ClosureTyper<'tcx>+'a),
                                                 fulfillment_cx: &mut FulfillmentContext<'tcx>,
                                                 span: Span,
                                                 body_id: ast::NodeId,
                                                 value: &T)
                                                 -> T
-    where T : TypeFoldable<'tcx> + HasProjectionTypes + Clone + Repr
+    where T : TypeFoldable<'tcx> + HasTypeFlags
 {
-    debug!("normalize_associated_types_in(value={})", value.repr());
-    let mut selcx = SelectionContext::new(infcx, typer);
+    debug!("normalize_associated_types_in(value={:?})", value);
+    let mut selcx = SelectionContext::new(infcx);
     let cause = ObligationCause::new(span, body_id, MiscObligation);
     let Normalized { value: result, obligations } = traits::normalize(&mut selcx, cause, value);
-    debug!("normalize_associated_types_in: result={} predicates={}",
-           result.repr(),
-           obligations.repr());
+    debug!("normalize_associated_types_in: result={:?} predicates={:?}",
+           result,
+           obligations);
     for obligation in obligations {
         fulfillment_cx.register_predicate_obligation(infcx, obligation);
     }