1
Fork 0

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 6a4dd19ade
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 56 additions and 8 deletions

View file

@ -1112,6 +1112,9 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
let (items, usage_map) = collector::collect_crate_mono_items(tcx, collection_mode);
// If there was an error during collection (e.g. from one of the constants we evaluated),
// then we stop here. This way codegen does not have to worry about failing constants.
// (codegen relies on this and ICEs will happen if this is violated.)
tcx.dcx().abort_if_errors();
let (codegen_units, _) = tcx.sess.time("partition_and_assert_distinct_symbols", || {