about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-14 15:44:33 +0100
committerGitHub <noreply@github.com>2024-03-14 15:44:33 +0100
commit47abd3a4862b172d059d03a87b3f2522d6bd6958 (patch)
treeca8a8efe5e954fda9edac0d98debca60ac3c7883
parent221402e86301a9680f6c0dbee197ce83b0ff99e3 (diff)
parentfe7be63daed8ddce4fc1cf7ba65cb5fb3b27ca75 (diff)
downloadrust-47abd3a4862b172d059d03a87b3f2522d6bd6958.tar.gz
rust-47abd3a4862b172d059d03a87b3f2522d6bd6958.zip
Rollup merge of #122287 - RalfJung:simd-static-assert, r=pnkfelix
add test ensuring simd codegen checks don't run when a static assertion failed

stdarch relies on this to ensure that SIMD indices are in bounds.

I would love to know why this works, but I can't figure out where codegen decides to not codegen a function if a required-const does not evaluate. `@oli-obk` `@bjorn3` do you have any idea?
-rw-r--r--src/constant.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/constant.rs b/src/constant.rs
index 18c5960ffc6..cec479218b7 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -71,7 +71,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
     // This cannot fail because we checked all required_consts in advance.
     let val = cv
         .eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
-        .expect("erroneous constant not captured by required_consts");
+        .expect("erroneous constant missed by mono item collection");
     (val, cv.ty())
 }