]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/traits/specialize/mod.rs
move projection mode into parameter environment
[rust.git] / src / librustc / traits / specialize / mod.rs
index 0e5779f9d17935b291fc1d72aec74fd879166c0f..4d7fdbd881ec34efd0201d1dd56bd494adfdf39e 100644 (file)
@@ -122,7 +122,7 @@ pub fn find_associated_item<'a, 'tcx>(
     let ancestors = trait_def.ancestors(tcx, impl_data.impl_def_id);
     match ancestors.defs(tcx, item.name, item.kind).next() {
         Some(node_item) => {
-            let substs = tcx.infer_ctxt((), Reveal::All).enter(|infcx| {
+            let substs = tcx.infer_ctxt(Reveal::All).enter(|infcx| {
                 let substs = substs.rebase_onto(tcx, trait_def_id, impl_data.substs);
                 let substs = translate_substs(&infcx, impl_data.impl_def_id,
                                               substs, node_item.node);
@@ -180,11 +180,11 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 
     // create a parameter environment corresponding to a (skolemized) instantiation of impl1
-    let penv = tcx.parameter_environment(impl1_def_id);
+    let penv = tcx.param_env(impl1_def_id);
     let impl1_trait_ref = tcx.impl_trait_ref(impl1_def_id).unwrap();
 
     // Create a infcx, taking the predicates of impl1 as assumptions:
-    let result = tcx.infer_ctxt(penv, Reveal::UserFacing).enter(|infcx| {
+    let result = tcx.infer_ctxt(penv).enter(|infcx| {
         // Normalize the trait reference. The WF rules ought to ensure
         // that this always succeeds.
         let impl1_trait_ref =
@@ -250,7 +250,7 @@ fn fulfill_implication<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
                        source_trait_ref,
                        target_trait_ref,
                        errors,
-                       infcx.parameter_environment.caller_bounds);
+                       infcx.param_env.caller_bounds);
                 Err(())
             }