]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/const_eval/eval_queries.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / librustc_mir / const_eval / eval_queries.rs
index 1bf748e66e2a04c90b756594e5cfe8ba9bbd7b22..ffbff00cf376005a6b983d0ddc9c247b1ad67383 100644 (file)
@@ -186,7 +186,12 @@ fn validate_and_turn_into_const<'tcx>(
         if cid.promoted.is_none() {
             let mut ref_tracking = RefTracking::new(mplace);
             while let Some((mplace, path)) = ref_tracking.todo.pop() {
-                ecx.validate_operand(mplace.into(), path, Some(&mut ref_tracking))?;
+                ecx.const_validate_operand(
+                    mplace.into(),
+                    path,
+                    &mut ref_tracking,
+                    /*may_ref_to_static*/ is_static,
+                )?;
             }
         }
         // Now that we validated, turn this into a proper constant.
@@ -226,7 +231,7 @@ pub fn const_eval_validated_provider<'tcx>(
         match tcx.const_eval_validated(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
-            // dedupliate calls
+            // deduplicate calls
             other => return other,
         }
     }
@@ -267,7 +272,7 @@ pub fn const_eval_raw_provider<'tcx>(
         match tcx.const_eval_raw(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
-            // dedupliate calls
+            // deduplicate calls
             other => return other,
         }
     }