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?
This commit is contained in:
Matthias Krüger 2024-03-14 15:44:33 +01:00 committed by GitHub
commit 47abd3a486

View File

@ -71,7 +71,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
// This cannot fail because we checked all required_consts in advance. // This cannot fail because we checked all required_consts in advance.
let val = cv let val = cv
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span)) .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()) (val, cv.ty())
} }