]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/transform/type_check.rs
move projection mode into parameter environment
[rust.git] / src / librustc_mir / transform / type_check.rs
index b325470ec818cadcd33f6dd3309ec408400a5351..f7055f90f0f830d757add822f3b6222d42a094d6 100644 (file)
@@ -12,7 +12,7 @@
 #![allow(unreachable_code)]
 
 use rustc::infer::{self, InferCtxt, InferOk};
-use rustc::traits::{self, Reveal};
+use rustc::traits;
 use rustc::ty::fold::TypeFoldable;
 use rustc::ty::{self, Ty, TyCtxt, TypeVariants};
 use rustc::middle::const_val::ConstVal;
@@ -534,7 +534,7 @@ fn check_call_inputs(&mut self,
 
     fn is_box_free(&self, operand: &Operand<'tcx>) -> bool {
         match operand {
-            &Operand::Constant(Constant {
+            &Operand::Constant(box Constant {
                 literal: Literal::Value {
                     value: ConstVal::Function(def_id, _), ..
                 }, ..
@@ -744,15 +744,15 @@ fn run_pass<'a, 'tcx>(&self,
                           mir: &mut Mir<'tcx>) {
         let item_id = src.item_id();
         let def_id = tcx.hir.local_def_id(item_id);
-        debug!("run_pass: {}", tcx.item_path_str(def_id));
+        debug!("run_pass: {:?}", def_id);
 
         if tcx.sess.err_count() > 0 {
             // compiling a broken program can obviously result in a
             // broken MIR, so try not to report duplicate errors.
             return;
         }
-        let param_env = ty::ParameterEnvironment::for_item(tcx, item_id);
-        tcx.infer_ctxt(param_env, Reveal::UserFacing).enter(|infcx| {
+        let param_env = tcx.param_env(def_id);
+        tcx.infer_ctxt(param_env).enter(|infcx| {
             let mut checker = TypeChecker::new(&infcx, item_id);
             {
                 let mut verifier = TypeVerifier::new(&mut checker, mir);