about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-04-13Move `select_unpredictable` to the `hint` moduleAmanieu d'Antras-59/+60
2025-04-12https://github.com/rust-lang/rust/pull/139717#issuecomment-2799036117 🥴наб-2/+2
2025-04-12Rollup merge of #139713 - GenYuLi:master, r=compiler-errorsChris Denton-1/+1
Fix typo in documentation Correct the misspelling of "indentifier" to "identifier" in `library/alloc/src/fmt.rs`.
2025-04-12Rollup merge of #139701 - Rudxain:doc-pow2, r=tgross35Chris Denton-1/+1
docs: clarify uint exponent for `is_power_of_two` This makes the documentation more explicit for that method. I know this might seem "nit-picky", but `k` could be interpreted as "any Real or Complex number". A trivial example would be $`3 = 2^{log_2(3)}`$ which "proves that three is a power of two" (according to that vague definition). BTW, when I read the implementation, I was surprised to see that `1` is considered a power of 2 despite being odd (it does make sense in some contexts, but still not intuitive). So I wrote "positive int" before correcting it to "unsigned int"
2025-04-12Rollup merge of #139688 - rust-lang:notriddle/io-result-unbox, r=GuillaumeGomezChris Denton-0/+2
rustdoc-search: add unbox flag to Result aliases Fixes #139665
2025-04-12Rollup merge of #139382 - ChrisDenton:windows-bindgen-0-61, r=Mark-SimulacrumChris Denton-28/+285
Update windows-bindgen to 0.61.0 This updates the automatically generate Windows API bindings. Not much changed this time: - There's now `Default` implementations for many types, which is convenient. It does however conflict with one place where we implemented a non-zeroed default (to set the length field). But that's no big problem. - The `--no-core` flag has been renamed to `--no-deps` to more accurately reflect its meaning (i.e. generate all necessary code without requiring additional dependencies). - The `--link` flag allows us to set the location of the `link!` macro. Currently we use our workspace's `windows_targets` crate but we could move it into library/std using `--link`. However, this would need to be co-ordinated with the `backtrace` crate (which is a separate crate but included in std using `#[path]`). So I've left that for another time.
2025-04-12Rollup merge of #139276 - tgross35:enable-f16-without-neon, r=Mark-SimulacrumChris Denton-7/+0
Revert "Disable `f16` on Aarch64 without `neon`" The LLVM issue [1] was resolved and the fix was synced to rust-lang/rust in [2]. This reverts commit c51b229140c885cac757a405a328a07e90d5bca9. [1]: https://github.com/llvm/llvm-project/issues/129394 [2]: https://github.com/rust-lang/rust/pull/138695 try-job: aarch64-gnu try-job: aarch64-gnu-debug try-job: armhf-gnu try-job: dist-various-1
2025-04-12Rollup merge of #139163 - scottmcm:stabilize-exact_div, r=RalfJungChris Denton-6/+1
indirect-const-stabilize the `exact_div` intrinsic See https://github.com/rust-lang/rust/issues/74985#issuecomment-2759179184
2025-04-12Optimize `ToString` implementation for integersGuillaume Gomez-9/+67
2025-04-12Fix typo in documentationGenYuLi-1/+1
Correct the misspelling of "indentifier" to "identifier" in `library/alloc/src/fmt.rs`.
2025-04-12Unify owned Args types between platformsThalia Archibald-222/+77
2025-04-12Use unsupported args for espidf and vitaThalia Archibald-14/+3
2025-04-12cfg(kcfi)Alice Ryhl-1/+8
2025-04-12Move args into std::sysThalia Archibald-41/+53
2025-04-12RISC-V: tidying: Fix separation of I-related extensionsTsukasa OI-1/+1
The author intended to split: 1. Former "I" extensions 2. Other "I"-related extensions but incorrectly separated between "Zihpm" (a supplement of "Zicntr" which is a former "I" extension) and "Zifencei" (a former "I" extension) while the author intended making a separation between "Zifencei" and "Zihintpause" (not a part of "I"). This commit fixes the separation.
2025-04-12RISC-V: doc: tidying: Move link to the ISA ManualTsukasa OI-2/+2
Not only moving the link to the end of the section, this commit changes the link so that we can reach to the *ratified* ISA manuals (note that, while the original URL (GitHub) is a good place to browse the latest draft, it's not easy to know which is the ratified version; even "Releases" page is not helpful since it's regularly updated).
2025-04-12RISC-V: doc: Updated status and clarificationTsukasa OI-24/+21
Some extensions are ratified at least on the ISA specification version 20240411. This commit moves such extensions. This commit also changes that: 1. Lower indentation of "Zk*" and "Zbk*" extensions to avoid extension groups from being misleading inside this section. 2. Raise indentation of "Zfhmin" and "Zhinxmin" extensions to show that they are a strict subset of "Zfh" and "Zhinx" (respectively). 3. Clarify that "s" is not an extension but a feature notifying the existence of the supervisor-level ISA. 4. Clarify that "h" is not just an existence of the hypervisor-level ISA but is also an extension name ("H").
2025-04-12RISC-V: doc: Capitalize some words for consistencyTsukasa OI-5/+5
RISC-V extension names are capitalized for consistency.
2025-04-12docs: clarify uint exponent for `is_power_of_two`Ricardo Fernández Serrata-1/+1
2025-04-11Auto merge of #139430 - scottmcm:polymorphic-array-into-iter, r=cuviperbors-141/+420
Polymorphize `array::IntoIter`'s iterator impl Today we emit all the iterator methods for every different array width. That's wasteful since the actual array length never even comes into it -- the indices used are from the separate `alive: IndexRange` field, not even the `N` const param. This PR switches things so that an `array::IntoIter<T, N>` stores a `PolymorphicIter<[MaybeUninit<T>; N]>`, which we *unsize* to `PolymorphicIter<[MaybeUninit<T>]>` and call methods on that non-`Sized` type for all the iterator methods. That also necessarily makes the layout consistent between the different lengths of arrays, because of the unsizing. Compare that to today <https://rust.godbolt.org/z/Prb4xMPrb>, where different widths can't even be deduped because the offset to the indices is different for different array widths.
2025-04-11Rollup merge of #137835 - scottmcm:signum, r=compiler-errorsJacob Pratt-8/+7
Use `BinOp::Cmp` for `iNN::signum` This way it can use the nice new LLVM intrinsic in LLVM20.
2025-04-11rustdoc-search: add unbox flag to Result aliasesMichael Howell-0/+2
Fixes #139665
2025-04-11Use with_native_path for WindowsChris Denton-47/+86
Also add a WCStr type
2025-04-11Update library/core/src/fmt/rt.rsAlice Ryhl-1/+0
2025-04-11Fix profiler_builtins build script to handle full path to profiler libJesus Checa Hidalgo-2/+8
LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds), but `-l` expects a library name, not a path. After #138273, this caused builds to fail with a "could not find native static library" error. This patch updates the build script to split the path into directory and filename, using `cargo::rustc-link-search` for the directory and `cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to correctly link the static library even when an absolute path is provided.
2025-04-11Replace proc_macro::SourceFile by Span::{file, local_file}.Mara Bos-56/+21
2025-04-11sync::mpsc: prevent double free on `Drop`Petros Angelatos-1/+7
This PR is fixing a regression introduced by #121646 that can lead to a double free when dropping the channel. The details of the bug can be found in the corresponding crossbeam PR https://github.com/crossbeam-rs/crossbeam/pull/1187 Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2025-04-11sync::mpsc: add miri reproducer of double freePetros Angelatos-0/+5
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2025-04-11Remove proc_macro::SourceFile::is_real().Mara Bos-20/+2
2025-04-11hmmbendn-1/+3
2025-04-11fix broken intra doc linksbendn-6/+6
2025-04-11Implement Default for raw pointersChris Denton-0/+33
2025-04-11cfi: Remove #[no_sanitize(cfi)] for extern weak functionsBastian Kersting-40/+0
Previously (https://github.com/rust-lang/rust/pull/115200, https://github.com/rust-lang/rust/pull/138002), we added `#[no_sanitize(cfi)]` to all code paths that call to a weakly linked function. In https://github.com/rust-lang/rust/pull/138349 we fixed the root cause for this issue, which means we can now remove the corresponding attributes.
2025-04-10Stabilize `slice_as_chunks` library featureScott McMurray-15/+12
2025-04-11Rollup merge of #139600 - tgross35:update-builtins, r=tgross35Stuart Cook-4/+4
Update `compiler-builtins` to 0.1.153 Includes the following changes: * Avoid OOB access in `memcpy` and `memmove` [1] * Enable intrinsics on AVR [2] * `libm` updates to avoid using `core::arch` vector intrinsics [3] * Re-enable `f16` on aarch64 without Neon [4] [1]: https://github.com/rust-lang/compiler-builtins/pull/799 [2]: https://github.com/rust-lang/compiler-builtins/pull/791 [3]: https://github.com/rust-lang/compiler-builtins/pull/814 [4]: https://github.com/rust-lang/compiler-builtins/pull/809
2025-04-11Rollup merge of #139447 - izarma:issue-108131-fix, r=scottmcmStuart Cook-6/+6
doc changes: debug assertions -> overflow checks This PR is for the following issue: https://github.com/rust-lang/rust/issues/108131 has some changes in docs
2025-04-11Rollup merge of #137447 - folkertdev:simd-extract-insert-dyn, r=scottmcmStuart Cook-3/+36
add `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}` fixes https://github.com/rust-lang/rust/issues/137372 adds `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`, which contrary to their non-dyn counterparts allow a non-const index. Many platforms (but notably not x86_64 or aarch64) have dedicated instructions for this operation, which stdarch can emit with this change. Future work is to also make the `Index` operation on the `Simd` type emit this operation, but the intrinsic can't be used directly. We'll need some MIR shenanigans for that. r? `@ghost`
2025-04-10indirect-const-stabilize the `exact_div` intrinsicScott McMurray-6/+1
2025-04-10Apply suggestions from code reviewCelina G. Val-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-04-10Auto merge of #137412 - scottmcm:redo-swap, r=cuviperbors-48/+124
Ensure `swap_nonoverlapping` is really always untyped This replaces #134954, which was arguably overcomplicated. ## Fixes #134713 Actually using the type passed to `ptr::swap_nonoverlapping` for anything other than its size + align turns out to not work, so this goes back to always erasing the types down to just bytes. (Except in `const`, which keeps doing the same thing as before to preserve `@RalfJung's` fix from #134689) ## Fixes #134946 I'd previously moved the swapping to use auto-vectorization *on bytes*, but someone pointed out on Discord that the tail loop handling from that left a whole bunch of byte-by-byte swapping around. This goes back to manual tail handling to avoid that, then still triggers auto-vectorization on pointer-width values. (So you'll see `<4 x i64>` on `x86-64-v3` for example.)
2025-04-10add `simd_insert_dyn` and `simd_extract_dyn`Folkert de Vries-3/+36
2025-04-10Update `compiler-builtins` to 0.1.153Trevor Gross-4/+4
Includes the following changes: * Avoid OOB access in `memcpy` and `memmove` [1] * Enable intrinsics on AVR [2] * `libm` updates to avoid using `core::arch` vector intrinsics [3] * Re-enable `f16` on aarch64 without Neon [4] [1]: https://github.com/rust-lang/compiler-builtins/pull/799 [2]: https://github.com/rust-lang/compiler-builtins/pull/791 [3]: https://github.com/rust-lang/compiler-builtins/pull/814 [4]: https://github.com/rust-lang/compiler-builtins/pull/809
2025-04-10cfi: do not transmute function pointers in formatting codeAlice Ryhl-23/+24
2025-04-10Disable cfg check for the recently-merged target features to allow stdarch ↵sayantn-1/+11
update
2025-04-10Don't allow flattened format_args in const.Mara Bos-1/+8
2025-04-10Use posix_spawn on cygwinBerrysoft-2/+6
2025-04-09PR feedbackScott McMurray-8/+8
2025-04-10Doc more control flow behaviour for return keywordLynnesbian-0/+22
2025-04-10Document async block control flow in async keywordLynnesbian-0/+38
2025-04-10Auto merge of #139279 - BoxyUwU:bump-boostrap, r=jieyouxubors-270/+162
Bump boostrap compiler to new beta try-job: `*msvc*`