about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-02-06 12:16:49 -0800
committerMichael Goulet <michael@errs.io>2022-02-11 12:45:51 -0800
commit77dae2d25d900a8e7493c548498cdc94bdcee3d9 (patch)
treed0a3f207a61fd7da0ff094c84f4499e192149cc4 /compiler/rustc_const_eval/src/const_eval
parent4ad272b282dc28c1366cf0516315f00b13d1621e (diff)
downloadrust-77dae2d25d900a8e7493c548498cdc94bdcee3d9.tar.gz
rust-77dae2d25d900a8e7493c548498cdc94bdcee3d9.zip
skip const eval if we have an error in borrowck
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/eval_queries.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
index 9dc34260de7..7235b8416ad 100644
--- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -287,6 +287,9 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
             if let Some(error_reported) = tcx.typeck_opt_const_arg(def).tainted_by_errors {
                 return Err(ErrorHandled::Reported(error_reported));
             }
+            if tcx.mir_borrowck_opt_const_arg(def).tainted_by_errors {
+                return Err(ErrorHandled::Reported(ErrorReported {}));
+            }
         }
         if !tcx.is_mir_available(def.did) {
             tcx.sess.delay_span_bug(