Skip to content

Commit

Permalink
Rollup merge of rust-lang#122287 - RalfJung:simd-static-assert, r=pnk…
Browse files Browse the repository at this point in the history
…felix

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?
  • Loading branch information
matthiaskrgr authored Mar 14, 2024
2 parents 221402e + fe7be63 commit 47abd3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 47abd3a

Please sign in to comment.