Skip to content

Commit

Permalink
Auto merge of #120863 - saethlin:slice-get-checked, r=the8472
Browse files Browse the repository at this point in the history
Use intrinsics::debug_assertions in debug_assert_nounwind

This is the first item in rust-lang/rust#120848.

Based on the benchmarking in this PR, it looks like, for the programs in our benchmark suite, enabling all these additional checks does not introduce significant compile-time overhead, with the single exception of `Alignment::new_unchecked`. Therefore, I've added `#[cfg(debug_assertions)]` to that one call site, so that it remains compiled out in the distributed standard library.

The trailing commas in the previous calls to `debug_assert_nounwind!` were causing the macro to expand to `panic_nouwnind_fmt`, which requires more work to set up its arguments, and that overhead alone is measured between this perf run and the next: rust-lang/rust#120863 (comment)
  • Loading branch information
bors committed Feb 20, 2024
2 parents 13a60d4 f192bfc commit f9b8446
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit f9b8446

Please sign in to comment.