rust/library
Matthias Krüger c93801cb20
Rollup merge of #148765 - joboet:split-up-thread, r=ChrisDenton
std: split up the `thread` module

Almost all functionality in `std::thread` is currently implemented in `thread/mod.rs`, resulting in a *huge* file with more than 2000 lines and multiple, interoperating `unsafe` sections. This PR splits the file up into multiple different private modules, each implementing mostly independent parts of the functionality. The only remaining `unsafe` interplay is that of the `lifecycle` and `scope` modules, the `spawn_scoped` implementation relies on the live thread count being updated correctly by the `lifecycle` module.

This PR contains no functional changes and only moves code around for the most part, with a few notable exceptions:
* `with_current_name` is moved to the already existing `current` module and now uses the `name` method instead of calculating the name from private fields. The old code was just a reimplementation of that method anyway.
* The private `JoinInner` type used to implement both join handles now has some more methods (`is_finished`, `thread` and the `AsInner`/`IntoInner` implementations) to avoid having to expose private fields and their invariants.
* The private `spawn_unchecked_` (note the underscore) method of `Builder` is now a freestanding function in `lifecycle`.

The rest of the changes are just visibility annotations.

I realise this PR ended up quite large – let me know if there is anyway I can aid the review process.

Edit: I've simplified the diff by adding an intermediate commit that creates all the new files by duplicating `mod.rs`. The actual changes in the second commit thus appear to delete the non-relevant parts from the respective file.
2025-11-29 20:54:06 +01:00
..
alloc Add impl TrustedLen on BTree{Map,Set} iterators 2025-11-27 14:48:18 +02:00
alloctests Rollup merge of #147035 - joboet:extract_if_debug, r=tgross35 2025-11-20 11:15:50 +01:00
backtrace@b65ab935fb Update the backtrace submodule 2025-06-16 07:00:13 +00:00
compiler-builtins stabilize asm_cfg 2025-10-15 20:43:53 +02:00
core Auto merge of #149441 - jhpratt:rollup-4hmqc0z, r=jhpratt 2025-11-29 05:20:07 +00:00
coretests Auto merge of #149397 - matthiaskrgr:rollup-go79y6a, r=matthiaskrgr 2025-11-27 19:24:40 +00:00
panic_abort Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
panic_unwind Fix new function_casts_as_integer lint errors in core, std, panic_unwind and compiler crates 2025-11-10 16:38:28 +01:00
portable-simd Remove more #[must_use] from portable-simd 2025-11-11 13:27:04 -08:00
proc_macro Rollup merge of #148048 - thaliaarchi:stabilize-maybeuninit-write-slice, r=Mark-Simulacrum 2025-11-27 12:36:48 +11:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
rustc-std-workspace-core Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
rustc-std-workspace-std Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
std Rollup merge of #148765 - joboet:split-up-thread, r=ChrisDenton 2025-11-29 20:54:06 +01:00
std_detect rustc_target: aarch64: Remove deprecated FEAT_TME 2025-11-25 00:43:01 +00:00
stdarch Merge pull request #1961 from folkertdev/pmadd-correct-signedness 2025-11-17 15:52:10 +00:00
sysroot add autodiff examples 2025-11-16 23:35:37 -05:00
test Rollup merge of #142807 - sourcefrog:failfast, r=dtolnay 2025-09-17 14:56:41 +10:00
unwind Move wasm throw intrinsic back to unwind 2025-10-30 15:13:32 +03:00
windows_targets Rollup merge of #144399 - bjorn3:stdlib_tests_separate_packages, r=Mark-Simulacrum 2025-07-28 08:36:53 +02:00
Cargo.lock Motor OS: make decode_error_kind more comprehensive 2025-11-24 21:17:20 -08:00
Cargo.toml Remove the std workspace patch for compiler-builtins 2025-08-19 18:56:35 +00:00