about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-02-25chore: release v0.1.149github-actions[bot]-1/+7
2025-02-25Make a subset of `libm` symbols weakly available on all platformsTrevor Gross-115/+173
018616e78b ("Always have math functions but with `weak` linking attribute if we can") made all math symbols available on platforms that support weak linkage. This caused some unexpected regressions, however, because our less accurate and sometimes slow routines were being selected over the system `libm`, which also tends to be weak [1]. Thus, 0fab77e8d7 ("Don't include `math` for `unix` and `wasi` targets") was applied to undo these changes on many platforms. Now that some improvements have been made to `libm`, add back a subset of these functions: * cbrt * ceil * copysign * fabs * fdim * floor * fma * fmax * fmaximum * fmin * fminimum * fmod * rint * round * roundeven * sqrt * trunc This list includes only functions that produce exact results (verified with exhaustive / extensive tests, and also required by IEEE in most cases), and for which benchmarks indicate performance similar to or better than Musl's soft float math routines [^1]. All except `cbrt` also have `f16` and `f128` implementations. Once more routines meet these criteria, we can move them from platform-specific availability to always available. Once this change makes it to rust-lang/rust, we will also be able to move the relevant functions from `std` to `core`. [^1]: We still rely on the backend to provide optimized assmebly routines when available. [1]: https://github.com/rust-lang/rust/issues/128386
2025-02-25fix: attr cast for espidfSergio Gasquez-1/+1
2025-02-25replaced extern "rust-intrinsic" block with core::ptr::copy_nonoverlappingaaishwarymishra@gmail.com-15/+2
using core::ptr::copy_nonoverlapping for memory operations changes core::ptr::coopy_nonoverlapping to crate::ptr::
2025-02-25fix doc in library/core/src/pin.rsxizheyin-2/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-25Rollup merge of #137515 - tgross35:update-builtins, r=tgross35León Orell Valerian Liehr-4/+4
Update `compiler-builtins` to 0.1.148 Includes `f16` symbols on MIPS [1], updates for `libm` [2], and reapplies the patch that drops the `public_test_deps!` macro [3]. [1]: https://github.com/rust-lang/compiler-builtins/pull/762 [2]: https://github.com/rust-lang/compiler-builtins/pull/765 [3]: https://github.com/rust-lang/compiler-builtins/pull/766 try-job: aarch64-gnu try-job: i686-mingw-1 try-job: i686-mingw-2 try-job: test-various try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: x86_64-rust-for-linux
2025-02-25Use `.expect(..)` insteadMahmoud Mazouz-5/+10
2025-02-25Rollup merge of #137576 - goffrie:setvalzst, r=lcnrLeón Orell Valerian Liehr-1/+1
Don't doc-comment BTreeMap<K, SetValZST, A> This otherwise shows up in documentation as an empty impl block (worse, at the *top* of the docs above the public impls).
2025-02-25disable a potentially bogus test on MiriRalf Jung-0/+1
2025-02-25Auto merge of #137571 - tgross35:rollup-i1tcnv1, r=tgross35bors-49/+50
Rollup of 8 pull requests Successful merges: - #134655 (Stabilize `hash_extract_if`) - #135933 (Explain how Vec::with_capacity is faithful) - #136668 (Stabilize `core::str::from_utf8_mut` as `const`) - #136775 (Update `String::from_raw_parts` safety requirements) - #137109 (stabilize extract_if) - #137349 (Implement `read_buf` for zkVM stdin) - #137493 (configure.py: don't instruct user to run nonexistent program) - #137516 (remove some unnecessary rustc_const_unstable) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-25fix doc in library/core/src/sync/atomic.rsxizheyin-5/+5
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-25fix doc path in std::fmt macroTapan Prakash-4/+4
2025-02-24Don't doc-comment BTreeMap<K, SetValZST, A>Geoffry Song-1/+1
2025-02-25Remove some `allow(unsafe_op_in_unsafe_fn)`s and use target_feature 1.1 in ↵Eduardo Sánchez Muñoz-71/+111
examples
2025-02-24Rollup merge of #137543 - petrochenkov:wintest, r=ChrisDentonMichael Goulet-0/+4
std: Fix another new symlink test on Windows Checking for `got_symlink_permission` first is a standard procedure for such tests.
2025-02-24Rollup merge of #137489 - ↵Michael Goulet-1433/+357
RalfJung:no-more-rustc_intrinsic_must_be_overridden, r=oli-obk remove `#[rustc_intrinsic_must_be_overridde]` In https://github.com/rust-lang/rust/pull/135031, we gained support for just leaving away the body. Now that the bootstrap compiler got bumped, stop using the old style and remove support for it. r? `@oli-obk` There are a few more mentions of this attribute in RA code that I didn't touch; Cc `@rust-lang/rust-analyzer`
2025-02-24Rollup merge of #137321 - aviraxp:patch-1, r=cuviperMichael Goulet-1/+3
Correct doc about `temp_dir()` behavior on Android Since commit https://github.com/aosp-mirror/platform_frameworks_base/commit/d5ccb038f69193fb63b5169d7adc5da19859c9d8, `TMPDIR` will be set to application's cache dir when app starts.
2025-02-24Rollup merge of #137516 - RalfJung:rustc_const_unstable-cleanup, r=AmanieuTrevor Gross-4/+1
remove some unnecessary rustc_const_unstable If the function is anyway unstable, it doesn't need to be `rustc_const_unstable`. `copy_from_slice` turns out to not do anything const-unstable itself, we just haven't stably committed to it being available in const yet. See [here](https://rustc-dev-guide.rust-lang.org/stability.html?highlight=rustc_const_stable_indirect) for more details on the `rustc_const_stable_indirect` attribute.
2025-02-24Rollup merge of #137349 - thaliaarchi:io-optional-methods/zkvm, r=NoratriebTrevor Gross-1/+9
Implement `read_buf` for zkVM stdin For the zkVM, even when a guest buffer is uninitialized, from the host's perspective it is just a normal piece of memory which was initialized before letting the guest write into it. This makes `sys_read` safe to use with an uninitialized buffer. See https://github.com/risc0/risc0/issues/2853. cc `@bobbobbio,` `@flaub` r? `@Noratrieb` Tracked in https://github.com/rust-lang/rust/issues/136756
2025-02-24Rollup merge of #137109 - bend-n:knife, r=oli-obkTrevor Gross-15/+9
stabilize extract_if Tracking issue: #43244 Closes: #43244 FCP completed: https://github.com/rust-lang/rust/issues/43244#issuecomment-2523595704
2025-02-24Rollup merge of #136775 - robertbastian:patch-2, r=AmanieuTrevor Gross-5/+2
Update `String::from_raw_parts` safety requirements These have become out of sync with `Vec::from_raw_part`'s safety requirements, and are likely to diverge again. I think it's safest to just point at `Vec`'s requirements. https://github.com/rust-lang/rust/issues/119206#issuecomment-2180116680
2025-02-24Rollup merge of #136668 - WaffleLapkin:from_utf8_mut, r=AmanieuTrevor Gross-3/+2
Stabilize `core::str::from_utf8_mut` as `const` cc #91006 (tracking issue) r? libs-api
2025-02-24Rollup merge of #135933 - hkBst:patch-19, r=workingjubileeTrevor Gross-5/+17
Explain how Vec::with_capacity is faithful This is a revival of https://github.com/rust-lang/rust/pull/99790 building on the prose of `@workingjubilee` and edits of `@jmaargh.` Closes https://github.com/rust-lang/rust/issues/99385.
2025-02-24Rollup merge of #134655 - GrigorenkoPV:hash_extract_if, r=cuviperTrevor Gross-16/+10
Stabilize `hash_extract_if` FCP complete: https://github.com/rust-lang/rust/issues/59618#issuecomment-2674880530 Tracking issue: #59618 Closes #59618
2025-02-24Stablize `string_extend_from_within`Alona Enraght-Moony-2/+1
2025-02-24Simplify trait error message for CoercePointee validationMichael Goulet-0/+1
2025-02-24libstd: rustdoc: correct note on fds 0/1/2 pre-mainнаб-1/+3
Closes: #137490
2025-02-24span: add a "future" editionDavid Wood-0/+38
It's hard to implement edition migrations without having a perma-unstable "future" edition to target.
2025-02-24powerpc: use `simd_ceil` and `simd_floor`Folkert de Vries-8/+2
2025-02-24nvptx: use `simd_fmin` and `simd_fmax` for `minnum` and `maxnum`Folkert de Vries-6/+2
2025-02-24wasm: use `simd_as` for float to integer conversionsFolkert de Vries-15/+6
2025-02-24fix doctest for __m128dusamoi-2/+2
2025-02-24mark AVX512 & AVXNECONVERT intrinsics as safeusamoi-18448/+21794
Mark all AVX512 & AVXNECONVERT SIMD-computing intrinsics as safe, except for those involving memory operations.
2025-02-24mark PCLMULQDQ intrinsics as safeusamoi-2/+2
Mark all PCLMULQDQ intrinsics as safe.
2025-02-24mark AES intrinsics as safeusamoi-12/+12
Mark all AES intrinsics as safe.
2025-02-24mark SHA intrinsics as safeusamoi-14/+14
Mark all SHA intrinsics as safe.
2025-02-24mark AVX2 intrinsics as safeusamoi-885/+1019
Mark all AVX2 SIMD-computing intrinsics as safe, except for those involving memory operations.
2025-02-24mark FMA intrinsics as safeusamoi-112/+144
Mark all FMA intrinsics as safe.
2025-02-24mark F16C intrinsics as safeusamoi-12/+16
Mark all F16C intrinsics as safe.
2025-02-24mark AVX intrinsics as safeusamoi-453/+503
Mark all AVX SIMD-computing intrinsics as safe, except for those involving memory operations and register operations. `AVX+SHA512`, `AVX+SM3` and `AVX+SM4` intrinsics are missing.
2025-02-24mark BMI2 intrinsics as safeusamoi-14/+14
Mark all BMI2 intrinsics as safe. `_mulx_u32` and `_mulx_u64` accepts a reference instead of a pointer.
2025-02-24mark BMI1 intrinsics as safeusamoi-19/+19
Mark all BMI1 intrinsics as safe.
2025-02-24mark LZCNT intrinsics as safeusamoi-2/+2
Mark all LZCNT intrinsics as safe.
2025-02-24mark POPCNT intrinsics as safeusamoi-2/+2
Mark all POPCNT intrinsics as safe. `_mm_popcnt_u32` and `_mm_popcnt_u64` are missing.
2025-02-24mark SSE4a intrinsics as safeusamoi-8/+8
Mark all SSE4a SIMD-computing intrinsics as safe, except for those involving memory operations.
2025-02-24mark SSE4.2 intrinsics as safeusamoi-38/+38
Mark all SSE4.2 intrinsics as safe.
2025-02-24mark SSE4.1 intrinsics as safeusamoi-189/+245
Mark all SSE4.1 SIMD-computing intrinsics as safe, except for those involving memory operations.
2025-02-24mark SSSE3 intrinsics as safeusamoi-63/+71
Mark all SSSE3 intrinsics as safe.
2025-02-24mark SSE3 SIMD intrinsics as safeusamoi-26/+30
Mark all SSE3 SIMD-computing intrinsics as safe, except for those involving memory operations.
2025-02-24mark SSE2 SIMD intrinsics as safeusamoi-471/+541
Mark all SSE2 SIMD-computing intrinsics as safe, except for those involving memory operations.