about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-07-22Remove `std_detect` from stdarch examplesJakub Beránek-30/+18
2025-07-22Fix warningJakub Beránek-0/+10
2025-07-22Move tests around to appease `tidy`Jakub Beránek-261/+256
2025-07-22remove `lazy_static` dependency from `intrinsic-test`Folkert de Vries-10/+2
we use `std::sync::LazyLock` now.
2025-07-22Update stdarch READMEJakub Beránek-9/+1
2025-07-22Reformat `std_detect`Jakub Beránek-182/+54
2025-07-22Make `std_detect` a direct dependency of `std`Jakub Beránek-16/+7
2025-07-22Move `std_detect` from `library/stdarch` to `library`Jakub Beránek-0/+0
2025-07-22work around not being able to project out of SIMD values any moreFolkert de Vries-4/+10
2025-07-22Auto merge of #144222 - Kobzol:stdarch-push, r=folkertdevbors-5042/+4642
stdarch subtree update Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/5531955678494ee28ec02130a6d94082ad4532da. Created using https://github.com/rust-lang/josh-sync. I saw that there were non-trivial changes made to `std_detect` in `stdarch` recently. So I want to get them merged here before we move forward with https://github.com/rust-lang/rust/pull/143412. r? `@folkertdev`
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-2/+2
2025-07-22Auto merge of #144205 - hkBst:flt2dec, r=workingjubileebors-11/+7
flt2dec: replace for loop by iter_mut Perf is explored in https://github.com/rust-lang/rust/issues/144118, which initially showed small losses, but then also showed significant gains. Both are real, but given the smallness of the losses, this seems a good change.
2025-07-21ci: Switch to nightly rustfmtTrevor Gross-2/+2
We are getting warnings in CI about unsupported features. There isn't any reason to use stable rustfmt so switch the channel here.
2025-07-22Rollup merge of #144212 - bjorn3:remove_unique_lang_item, r=oli-obk许杰友 Jieyou Xu (Joe)-2/+0
Remove the ptr_unique lang item Miri no longer uses it since https://github.com/rust-lang/miri/pull/4307.
2025-07-22Rollup merge of #143768 - Randl:const-try, r=oli-obk许杰友 Jieyou Xu (Joe)-69/+149
Constify Try, From, TryFrom and relevant traits
2025-07-21Auto merge of #144154 - tgross35:update-builtins, r=tgross35bors-476/+55
compiler-builtins subtree update Subtree update of `compiler-builtins` to https://github.com/rust-lang/compiler-builtins/commit/2cdde03950e8d10d37b8d13e1c1d3ce2e54f36c4. Created using https://github.com/rust-lang/josh-sync. Fixes: https://github.com/rust-lang/rust/issues/144076 r? `@ghost`
2025-07-21Fix broken TLS destructors on 32-bit win7roblabla-3/+14
On the 32-bit win7 target, we use OS TLS instead of native TLS, due to issues with how the OS handles alignment. Unfortunately, this caused issues due to the TLS destructors not running, causing memory leaks among other problems. On Windows, to support OS TLS, the TlsAlloc family of function is used by Rust. This function does not support TLS destructors at all. However, rust has some code to emulate those destructors, by leveraging the TLS support functionality found in the MSVC CRT (specifically, in tlssup.c of the CRT). Specifically, the CRT provides the ability to register callbacks that are called (among other things) on thread destruction. By registering our own callback, we can run through a list of registered destructors functions to execute. To use this functionality, the user must do two things: 1. They must put the address to their callback in a section between `.CRT$XLB` and `.CRT$XLY`. 2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to make sure the TLS support code in tlssup.c isn't garbage collected by the linker. Prior to this commit, this second bit wasn't being done properly by the Rust TLS support code. Instead of adding a reference to _tls_used, it instead had a reference to its own callback to prevent it from getting GC'd by the linker. While this is _also_ necessary, not having a reference on _tls_used made the entire support non-functional. This commit reworks the code to: 1. Add an unconditional `#[used]` attribute on the CALLBACK, which should be enough to prevent it from getting GC'd by the linker. 2. Add a reference to `_tls_used`, which should pull the TLS support code into the Rust programs and not let it be GC'd by the linker.
2025-07-21Constify Try, From, TryFromEvgenii Zheltonozhskii-69/+149
2025-07-21Stabilize const `TypeId::of`Oli Scherer-2/+2
2025-07-20Option::as_slice: fix commentRalf Jung-1/+1
2025-07-20flt2dec: use fill instead of loopMarijn Schouten-11/+7
2025-07-20Rollup merge of #143423 - hkBst:clippy-fix-1, r=workingjubileeGuillaume Gomez-32/+28
address clippy formatting nits - int_log10.rs: change top level doc comments to outer - collect.rs: remove empty line after doc comment - clippy fix: markdown indentation for indented items after line break: a markdown list item continued over multiples lines, but those following lines which are part of the same item are not indented - clippy fix: bound in one place: when there is a bound in angle brackets and another bound on the same variable in a where clause
2025-07-20Rollup merge of #143282 - nxsaken:strict_sub_signed, r=jhprattGuillaume Gomez-4/+41
Add `uX::strict_sub_signed` rust-lang/rust#116090 missed `strict_sub_signed`, adding it here. Part of rust-lang/rust#118260. r? ``@m-ou-se``
2025-07-20Remove the ptr_unique lang itembjorn3-2/+0
Miri no longer uses it.
2025-07-20Rollup merge of #144169 - RalfJung:type-id-fix, r=oli-obkMatthias Krüger-1/+1
interpret: fix TypeId pointers being considered data pointers Fixes https://github.com/rust-lang/miri/issues/4477 r? ````@oli-obk````
2025-07-20Rollup merge of #144111 - clarfonthey:maybe-uninit-deprecated, r=jhprattMatthias Krüger-112/+2
Remove deprecated `MaybeUninit` slice methods These were left in to make migration a bit easier, although they should be removed now since they were never stable.
2025-07-20Rollup merge of #143604 - nxsaken:const_float_round_methods, r=RalfJungMatthias Krüger-38/+32
Stabilize `const_float_round_methods` Closes rust-lang/rust#141555, waiting for FCP.
2025-07-20Rollup merge of #141260 - LuigiPiucco:volatile-null, r=RalfJungMatthias Krüger-78/+108
Allow volatile access to non-Rust memory, including address 0 This PR relaxes the `ub_check` in the `read_volatile`/`write_volatile` pointer operations to allow passing null. This is needed to support processors which hard-code peripheral registers on address 0, like the AVR chip ATtiny1626. LLVM understands this as valid and handles it correctly, as tested in my [PR to add a note about it](https://github.com/llvm/llvm-project/pull/139803/commits/6387c82255c56d3035d249eb54110695e76b8030#diff-81bbb96298c32fa901beb82ab3b97add27a410c01d577c1f8c01000ed2055826) (rustc generates the same LLVM IR as expected there when this PR is applied, and consequently the same AVR assembly). Follow-up and implementation of the discussions in: - https://internals.rust-lang.org/t/pre-rfc-conditionally-supported-volatile-access-to-address-0/12881/7 - https://github.com/Rahix/avr-device/pull/185; - [#t-lang > Adding the possibility of volatile access to address 0](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Adding.20the.20possibility.20of.20volatile.20access.20to.20address.200/with/513303502) - https://discourse.llvm.org/t/rfc-volatile-access-to-non-dereferenceable-memory-may-be-well-defined/86303 r? ````@RalfJung```` Also fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/29 (about as good as it'll get, null will likely never be a "normal" address in Rust)
2025-07-19Stabilize `new_zeroed_alloc`Thalia Archibald-41/+6
2025-07-19Remove deprecated MaybeUninit slice methodsltdk-112/+2
2025-07-20Add `#[rustc_intrinsic_const_stable_indirect]` to float roundingNurzhan Sakén-0/+20
intrinsics
2025-07-20Stabilize `const_float_round_methods`Nurzhan Sakén-38/+12
2025-07-19`available_parallelism`: Add documentation for why we don't look at `ulimit`Josh Triplett-0/+3
2025-07-19Document guarantees of poisoningAlisa Sireneva-25/+67
This mostly documents the current behavior of `Mutex` and `RwLock` as imperfect. It's unlikely that the situation improves significantly in the future, and even if it does, the rules will probably be more complicated than "poisoning is completely reliable", so this is a conservative guarantee. We also explicitly specify that `OnceLock` never poisons, even though it has an API similar to mutexes.
2025-07-19fix load-bearing typoRémy Rakic-1/+1
2025-07-19update `Atomic*::from_ptr` and `Atomic*::as_ptr` docsusamoi-9/+15
2025-07-19Auto merge of #144166 - matthiaskrgr:rollup-wccepuo, r=matthiaskrgrbors-75/+121
Rollup of 10 pull requests Successful merges: - rust-lang/rust#141076 (fix Zip unsoundness (again)) - rust-lang/rust#142444 (adding run-make test to autodiff) - rust-lang/rust#143704 (Be a bit more careful around exotic cycles in in the inliner) - rust-lang/rust#144073 (Don't test panic=unwind in panic_main.rs on Fuchsia) - rust-lang/rust#144083 (miri sleep tests: increase slack) - rust-lang/rust#144092 (bootstrap: Detect musl hosts) - rust-lang/rust#144098 (Do not lint private-in-public for RPITIT) - rust-lang/rust#144103 (Rename `emit_unless` to `emit_unless_delay`) - rust-lang/rust#144108 (Ignore tests/run-make/link-eh-frame-terminator/rmake.rs when cross-compiling) - rust-lang/rust#144115 (fix outdated comment) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-19interpret: fix TypeId pointers being considered data pointersRalf Jung-1/+1
2025-07-19Rollup merge of #141076 - the8472:fix-zip-panic-safety2, r=workingjubileeMatthias Krüger-75/+121
fix Zip unsoundness (again) Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. #82292 tried to fix unsoundness (#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (#86443), but the fix #86452 didn't fix it for nested Zip iterators (#137255). Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in #83791 but we haven't made use of that so far. fixes #137255
2025-07-19generate arrays of type-erased function pointersFolkert de Vries-83/+73
2025-07-19split rust code into cratesFolkert de Vries-38/+79
so that we get more parallelism out of cargo
2025-07-19update `Cargo.lock`Folkert de Vries-2/+2
2025-07-19combine rust files into one compilationFolkert de Vries-194/+199
2025-07-18Merge pull request #1862 from folkertdev/combine-c-filesAmanieu d'Antras-231/+261
`intrinsic-test`: combine C files for faster compilation
2025-07-18Merge pull request #1860 from folkertdev/stdarch-test-cleanupAmanieu d'Antras-138/+397
`stdarch-test`: various cleanups
2025-07-18clippy fix: bound in one placeMarijn Schouten-6/+7
2025-07-18Merge ref '82310651b93a' from rust-lang/rustThe rustc-josh-sync Cronjob Bot-4678/+735992
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 82310651b93a594a3fd69015e1562186a080d94c Filtered ref: e13c0be8f13737c64082b89ce834546079767ac4 This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-18Prepare for merging from rust-lang/rustThe rustc-josh-sync Cronjob Bot-1/+1
This updates the rust-version file to 82310651b93a594a3fd69015e1562186a080d94c.
2025-07-18Change the `memcmp` and `bcmp` return type to `c_int`Julien THILLARD-4/+5
Fix the return type of `memcmp` and `bcmp` builtin functions on targets with a `c_int` other than `i32`. Linked issue: https://github.com/rust-lang/rust/issues/144076
2025-07-18mem: Use `core::ffi::c_int`Trevor Gross-8/+1
This alias was added in 9897bfb8a ("Fix memset arguments for MSP430 target"), which predates `core::ffi`. Now that it exists we can just use `core::ffi::c_int`.