Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #120863 - saethlin:slice-get-checked, r=the8472
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