about summary refs log tree commit diff
path: root/src/librustc/mir
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-08 20:50:59 +0100
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-10 09:08:25 +0100
commit6e1bbff2c6816236bc3fe0a396c35c405b58fe23 (patch)
tree7e3109ad8da36dce82eaf6f4d56cbf576079d66d /src/librustc/mir
parent36b17567117a881f94b83ae6c80b6808a208e026 (diff)
downloadrust-6e1bbff2c6816236bc3fe0a396c35c405b58fe23.tar.gz
rust-6e1bbff2c6816236bc3fe0a396c35c405b58fe23.zip
Promoteds also need param envs.
This also allows us to use the `const_eval` query again without causing cycles
Diffstat (limited to 'src/librustc/mir')
-rw-r--r--src/librustc/mir/interpret/queries.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/mir/interpret/queries.rs b/src/librustc/mir/interpret/queries.rs
index 2b094bf911f..ed57f81e782 100644
--- a/src/librustc/mir/interpret/queries.rs
+++ b/src/librustc/mir/interpret/queries.rs
@@ -42,7 +42,7 @@ impl<'tcx> TyCtxt<'tcx> {
         let instance = ty::Instance::resolve(self, param_env, def_id, substs);
         if let Some(instance) = instance {
             if let Some(promoted) = promoted {
-                self.const_eval_promoted(instance, promoted)
+                self.const_eval_promoted(param_env, instance, promoted)
             } else {
                 self.const_eval_instance(param_env, instance, span)
             }
@@ -68,11 +68,11 @@ impl<'tcx> TyCtxt<'tcx> {
     /// Evaluate a promoted constant.
     pub fn const_eval_promoted(
         self,
+        param_env: ty::ParamEnv<'tcx>,
         instance: ty::Instance<'tcx>,
         promoted: mir::Promoted,
     ) -> ConstEvalResult<'tcx> {
         let cid = GlobalId { instance, promoted: Some(promoted) };
-        let param_env = ty::ParamEnv::reveal_all();
         self.const_eval_validated(param_env.and(cid))
     }
 }