about summary refs log tree commit diff
path: root/compiler/rustc_mir
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-08-10 15:11:40 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2020-09-19 10:36:36 +0200
commit69a6be73e619299a22a8ee7f64bb5532395f938d (patch)
tree554bbd13cad92c4b8ceba6d86bbbde085ec026c8 /compiler/rustc_mir
parent40c2087eb5623a724d0a24db925f9c9afcd4df0d (diff)
downloadrust-69a6be73e619299a22a8ee7f64bb5532395f938d.tar.gz
rust-69a6be73e619299a22a8ee7f64bb5532395f938d.zip
Rename const eval queries to reflect the validation changes
Diffstat (limited to 'compiler/rustc_mir')
-rw-r--r--compiler/rustc_mir/src/const_eval/eval_queries.rs14
-rw-r--r--compiler/rustc_mir/src/interpret/eval_context.rs2
-rw-r--r--compiler/rustc_mir/src/interpret/memory.rs2
-rw-r--r--compiler/rustc_mir/src/lib.rs4
4 files changed, 11 insertions, 11 deletions
diff --git a/compiler/rustc_mir/src/const_eval/eval_queries.rs b/compiler/rustc_mir/src/const_eval/eval_queries.rs
index 8f2a89d4676..3b01328df56 100644
--- a/compiler/rustc_mir/src/const_eval/eval_queries.rs
+++ b/compiler/rustc_mir/src/const_eval/eval_queries.rs
@@ -200,21 +200,21 @@ fn turn_into_const<'tcx>(
     );
     assert!(
         !is_static || cid.promoted.is_some(),
-        "the const eval query should not be used for statics, use `const_eval_raw` instead"
+        "the `const_eval_for_ty` query should not be used for statics, use `const_eval` instead"
     );
     // Turn this into a proper constant.
     op_to_const(&ecx, mplace.into())
 }
 
-pub fn const_eval_validated_provider<'tcx>(
+pub fn const_eval_for_ty_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::ConstEvalResult<'tcx> {
-    // see comment in const_eval_raw_provider for what we're doing here
+    // see comment in const_eval_provider for what we're doing here
     if key.param_env.reveal() == Reveal::All {
         let mut key = key;
         key.param_env = key.param_env.with_user_facing();
-        match tcx.const_eval_validated(key) {
+        match tcx.const_eval_for_ty(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
             // deduplicate calls
@@ -237,10 +237,10 @@ pub fn const_eval_validated_provider<'tcx>(
         });
     }
 
-    tcx.const_eval_raw(key).map(|val| turn_into_const(tcx, val, key))
+    tcx.const_eval(key).map(|val| turn_into_const(tcx, val, key))
 }
 
-pub fn const_eval_raw_provider<'tcx>(
+pub fn const_eval_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::ConstEvalRawResult<'tcx> {
@@ -255,7 +255,7 @@ pub fn const_eval_raw_provider<'tcx>(
     if key.param_env.reveal() == Reveal::All {
         let mut key = key;
         key.param_env = key.param_env.with_user_facing();
-        match tcx.const_eval_raw(key) {
+        match tcx.const_eval(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
             // deduplicate calls
diff --git a/compiler/rustc_mir/src/interpret/eval_context.rs b/compiler/rustc_mir/src/interpret/eval_context.rs
index 2bf14cca877..ef05d136da1 100644
--- a/compiler/rustc_mir/src/interpret/eval_context.rs
+++ b/compiler/rustc_mir/src/interpret/eval_context.rs
@@ -889,7 +889,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         } else {
             self.param_env
         };
-        let val = self.tcx.const_eval_raw(param_env.and(gid))?;
+        let val = self.tcx.const_eval(param_env.and(gid))?;
         self.raw_const_to_mplace(val)
     }
 
diff --git a/compiler/rustc_mir/src/interpret/memory.rs b/compiler/rustc_mir/src/interpret/memory.rs
index d4be2ce0568..64918a76857 100644
--- a/compiler/rustc_mir/src/interpret/memory.rs
+++ b/compiler/rustc_mir/src/interpret/memory.rs
@@ -469,7 +469,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
                 // Notice that every static has two `AllocId` that will resolve to the same
                 // thing here: one maps to `GlobalAlloc::Static`, this is the "lazy" ID,
                 // and the other one is maps to `GlobalAlloc::Memory`, this is returned by
-                // `const_eval_raw` and it is the "resolved" ID.
+                // `const_eval` and it is the "resolved" ID.
                 // The resolved ID is never used by the interpreted program, it is hidden.
                 // This is relied upon for soundness of const-patterns; a pointer to the resolved
                 // ID would "sidestep" the checks that make sure consts do not point to statics!
diff --git a/compiler/rustc_mir/src/lib.rs b/compiler/rustc_mir/src/lib.rs
index 42717f27384..07defa2d66d 100644
--- a/compiler/rustc_mir/src/lib.rs
+++ b/compiler/rustc_mir/src/lib.rs
@@ -52,8 +52,8 @@ pub fn provide(providers: &mut Providers) {
     transform::provide(providers);
     monomorphize::partitioning::provide(providers);
     monomorphize::polymorphize::provide(providers);
-    providers.const_eval_validated = const_eval::const_eval_validated_provider;
-    providers.const_eval_raw = const_eval::const_eval_raw_provider;
+    providers.const_eval_for_ty = const_eval::const_eval_for_ty_provider;
+    providers.const_eval = const_eval::const_eval_provider;
     providers.const_caller_location = const_eval::const_caller_location;
     providers.destructure_const = |tcx, param_env_and_value| {
         let (param_env, value) = param_env_and_value.into_parts();