rust/library
Nilstrieb 4ff6bb51e2
Rollup merge of #121196 - Nilstrieb:the-clever-solution, r=saethlin
Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)

The current complexities in `assert_unsafe_precondition` are delicately balancing several concerns, among them compile times for the cases where there are no debug assertions. This comes at a large runtime cost when the assertions are enabled, making the debug assertion compiler a lot slower, which is very annoying.

To avoid this, we always inline the check when building with debug assertions.

Numbers (compiling stage1 library after touching core):
- master: 80s
- just adding `#[inline(always)]` to the `cfg(bootstrap)` `debug_assertions` (equivalent to a bootstrap bump (uhh, i just realized that i was on a slightly outdated master so this bump might have happened already), (#121112)): 67s
- this: 54s

So this seems like a good solution. I think we can still get the same run-time perf improvements for other users too by massaging this code further (see my other PR about adding `#[rustc_no_mir_inline]` #121114) but this is a simpler step that solves the imminent problem of "holy shit my rustc is sooo slow".

Funny consequence: This now means compiling the standard library with dbeug assertions makes it faster (than without, when using debug assertions downstream)!

r? ```@saethlin``` (or anyone else if someone wants to review this)

fixes #121110, supposedly
2024-02-20 15:13:51 +01:00
..
alloc Rollup merge of #121224 - hi-rustin:rustin-patch-unit-binding, r=Mark-Simulacrum 2024-02-18 18:54:33 +01:00
backtrace@6145fe6bac Update backtrace submodule 2023-11-21 16:33:42 +01:00
core Rollup merge of #121196 - Nilstrieb:the-clever-solution, r=saethlin 2024-02-20 15:13:51 +01:00
panic_abort rustc: implement support for riscv32im_risc0_zkvm_elf 2024-01-22 10:07:36 -08:00
panic_unwind Improve wording of static_mut_ref 2024-02-18 06:01:40 +03:00
portable-simd Merge commit '649110751ef4f27440d7cc711b3e07d11bf02d4a' into sync-portable-simd-2024-02-18 2024-02-18 10:14:03 -05:00
proc_macro Auto merge of #116385 - kornelski:maybe-rename, r=Amanieu 2024-02-16 14:11:10 +00:00
profiler_builtins Add support for custom JSON targets when using build-std. 2024-02-05 10:20:42 +00:00
rtstartup library: Fix warnings in rtstartup 2024-01-06 01:32:03 +03:00
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #121310 - GrigorenkoPV:doc-smallfix, r=Nilstrieb 2024-02-20 07:35:48 +01:00
stdarch@d5fab978fe Update stdarch submodule 2024-02-19 10:49:20 +01:00
sysroot
test Actually abort in panic-abort-tests 2024-01-30 18:19:49 -08:00
unwind Enable Static Builds for FreeBSD 2024-01-11 15:26:16 +00:00