about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-02-09Rollup merge of #136213 - erickt:fs, r=Mark-SimulacrumUrgau-1/+17
Allow Rust to use a number of libc filesystem calls This allows Rust on Fuchsia to use a number of function calls from libc: * dirfd * fdatasync * flock with LOCK_EX, LOCK_SH, LOCK_NB, LOCK_UN * fstatat cc #120426 try-job: dist-various-2
2025-02-09Rollup merge of #134679 - ChrisDenton:rm-readonly, r=Mark-SimulacrumUrgau-5/+35
Windows: remove readonly files When calling `remove_file`, we shouldn't fail to delete readonly files. As the test makes clear, this make the Windows behaviour consistent with other platforms. This also makes us internally consistent with `remove_dir_all`. try-job: x86_64-msvc-ext1
2025-02-08occured -> occurredMichael Goulet-1/+1
2025-02-08Rustfmtbjorn3-250/+292
2025-02-08Document `Sum::sum` returns additive identities for `[]`Jaken Herman-1/+6
Because the neutral element of `<fNN as iter::Sum>` was changed to `neg_zero`, the documentation needed to be updated, as it was reporting inadequate information about what should be expected from the return. Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-02-08Implement Extend<AsciiChar> for StringMatthew Zeitlin-0/+39
2025-02-08Rollup merge of #136099 - Kijewski:pr-rc-str-default, r=ibraheemdevMatthias Krüger-3/+6
Optimize `Rc::<str>::default()` implementation This PR lets `impl Default for Rc<str>` re-use the implementation for `Rc::<[u8]>::default()`. The previous version only calculted the memory layout at runtime, even though it should be known at compile time, resulting in an additional function call. The same optimization is done for `Rc<CStr>`. Generated byte code: <https://godbolt.org/z/dfq73jsoP>. Resolves <https://github.com/rust-lang/rust/issues/135784>. Cc `@Billy-Sheppard.`
2025-02-08Rollup merge of #135696 - joboet:move_pal_io, r=NoratriebMatthias Krüger-318/+165
std: move `io` module out of `pal`, get rid of `sys_common::io` Part of #117276. This does two related things: 1. It moves the platform-specific definitions for `IoSlice`, `IoSliceMut` and `is_terminal` out of `pal` and into `sys` and unifies some of them. 2. It gets rid of `sys_common::io`, moving the non-platform-specific test helpers into `std::test_helpers` and the buffer size definition to the new `sys::io` module.
2025-02-08Replace an `assert!` with `debug_assert!` in `u256::shr`Trevor Gross-1/+23
The implementation came from the `compiler_builtins` port but this should be weakened to match other integer types.
2025-02-08Change how operators are `black_box`edTrevor Gross-7/+3
For some reason, the upcoming limb changes in [1] seem to ignore the black boxing when applied to the operator function. Changing to instead black box the inputs appears to fix this. [1]: https://github.com/rust-lang/libm/pull/503
2025-02-08Add simple icount benchmarks for `u256` operationsTrevor Gross-1/+104
2025-02-08Auto merge of #136713 - matthiaskrgr:rollup-sy6py39, r=matthiaskrgrbors-178/+377
Rollup of 7 pull requests Successful merges: - #135179 (Make sure to use `Receiver` trait when extracting object method candidate) - #136554 (Add `opt_alias_variances` and use it in outlives code) - #136556 ([AIX] Update tests/ui/wait-forked-but-failed-child.rs to accomodate exiting and idle processes.) - #136589 (Enable "jump to def" feature on rustc docs) - #136615 (sys: net: Add UEFI stubs) - #136635 (Remove outdated `base_port` calculation in std net test) - #136682 (Move two windows process tests to tests/ui) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-08Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`Frank Steffahn-3/+0
2025-02-07Decrease the allowed error for `cbrt`Trevor Gross-2/+3
With the correctly rounded implementation, we can reduce the ULP requirement for `cbrt` to zero. There is still an override required for `i586` because of the imprecise FMA.
2025-02-07Port the CORE-MATH version of `cbrt`Trevor Gross-103/+216
Replace our current implementation with one that is correctly rounded. Source: https://gitlab.inria.fr/core-math/core-math/-/blob/81d447bb1c46592291bec3476bc24fa2c2688c67/src/binary64/cbrt/cbrt.c
2025-02-07Add an enum representation of rounding modeTrevor Gross-0/+22
We only round using nearest, but some incoming code has more handling of rounding modes that would be nice to `match` on. Rather than checking integer values, add an enum representation.
2025-02-07Work arouind iai-callgrind apt failuresTrevor Gross-0/+2
Usually `cargo binstall iai-callgrind-runner` handles apt dependencies. However, the following has been happening: Err:11 mirror+file:/etc/apt/apt-mirrors.txt noble-updates/main amd64 libc6-dbg amd64 2.39-0ubuntu8.3 404 Not Found [IP: 40.81.13.82 80] E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/g/glibc/libc6-dbg_2.39-0ubuntu8.3_amd64.deb 404 Not Found [IP: 40.81.13.82 80] Fetched 19.8 MB in 6s (3138 kB/s) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Installing the dependencies manually seems to resolve the issue.
2025-02-07Uncomment some hex float tests that should work nowTrevor Gross-8/+5
2025-02-07some doc changesFolkert de Vries-5/+5
2025-02-07add `vec_splats` for s390xFolkert de Vries-2/+97
2025-02-07add `vec_abs` for s390xFolkert de Vries-1/+53
2025-02-07add `vec_max` and `vec_min` for s390xFolkert de Vries-2/+84
2025-02-07add `vec_sub` and `vec_mul` for s390xFolkert de Vries-1/+304
2025-02-07implement `VectorAdd` for `s390x`Folkert de Vries-2/+9
2025-02-07Small refactorings in `x86-intel.rs`sayantn-65/+18
remove `PRINT_MISSING_LISTS` as it was unused rename `PRINT_MISSING_LISTS_MARKDOWN`
2025-02-07Move all x86 std_detect tests to `x86-specific.rs` to reduce duplicationsayantn-91/+15
2025-02-07Remove CSR accessing tests as they are immediate UBsayantn-115/+4
2025-02-07Fix names of several testssayantn-57/+52
Rewrote `_mm_cvtps_ph` and `_mm_cvtph_ps` tests
2025-02-07Update `compiler-builtins` to 0.1.146Trevor Gross-4/+4
Exposes the error function so we can expose this in the standard library [1]. [1]: https://github.com/rust-lang/compiler-builtins/pull/753
2025-02-07Rollup merge of #136682 - ChrisDenton:move-win-proc-tests, r=joboetMatthias Krüger-148/+0
Move two windows process tests to tests/ui Spawning processes from std unit tests is not something it's well suited for so moving them into tests/ui is more robust and means we don't need to hack around `cmd.exe`. Follow up to #136630
2025-02-07Rollup merge of #136635 - jieyouxu:base_port, r=joboetMatthias Krüger-30/+3
Remove outdated `base_port` calculation in std net test This was never modified since `std::net` was originally introduced in 395709ca6d39ba1e095e404e1d2a169d918b7f0c, when at that time, each CI runner was running multiple jobs concurrently. This seems to have originally caused issues with jobs fighting over the same ports. This is not the case in the current CI infrastructure, so remove this relic in favor of a simple constant base port number. I double-checked `19600` and nearby port numbers, and this isn't a well-known port number AFAICT[^1]. Closes #136633. [^1]: At the time of writing.
2025-02-07Rollup merge of #136615 - Ayush1325:uefi-net-unsupported, r=joboetMatthias Krüger-0/+374
sys: net: Add UEFI stubs - Just a copy of sys/net/unsupported. - Will make the future net PRs easier to review. - The reason for a separate folder instead of standalone file is that UEFI has separate the protocols for v4 and v6, and thus will need some abstractions to implement the Rust interface. r? ``@jhpratt``
2025-02-07Improve examples for file lockingBen Schulz-2/+2
2025-02-07Rollup merge of #135945 - estebank:useless-parens, r=compiler-errorsMatthias Krüger-31/+31
Remove some unnecessary parens in `assert!` conditions While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-02-07Rollup merge of #134367 - WaffleLapkin:trait_upcasting_as_a_treat, ↵Matthias Krüger-1/+0
r=compiler-errors Stabilize `feature(trait_upcasting)` This feature was "done" for a while now, I think it's finally time to stabilize it! Stabilization report: https://github.com/rust-lang/rust/pull/134367#issuecomment-2545839841. cc reference PR: https://github.com/rust-lang/reference/pull/1622. Closes #65991 (tracking issue), closes #89460 (the lint is no longer future incompat). r? compiler-errors
2025-02-07std: get rid of `sys_common::io`joboet-88/+84
2025-02-07std: move `io` module out of `pal`joboet-230/+81
2025-02-07Use more explicit and reliable ptr select in sort implsLukas Bergdoll-18/+13
Using if ... with the intent to avoid branches can be surprising to readers and carries the risk of turning into jumps/branches generated by some future compiler version, breaking crucial optimizations. This commit replaces their usage with the explicit and IR annotated `bool::select_unpredictable`.
2025-02-07Clean up 'HashMap' and 'HashSet' docs;Gabriel Bjørnager Jensen-8/+8
2025-02-07Rollup merge of #136634 - bjoernager:const-mut-cursor, r=m-ou-seMatthias Krüger-2/+2
Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios. Closes: #130801 This PR stabilises the `const_mut_cursor` feature gate.
2025-02-07Move two windows process tests to tests/uiChris Denton-148/+0
2025-02-07library: doc: core::alloc::Allocator: trivial typo fixAskar Safin-1/+1
2025-02-06Convert `fmaf` to a generic implementationTrevor Gross-99/+129
Introduce a version of generic `fma` that works when there is a larger hardware-backed float type available to compute the result with more precision. This is currently used only for `f32`, but with some minor adjustments it should work for `f16` as well.
2025-02-06Remove or reduce the scope of `allow(unused)` where possibleTrevor Gross-29/+20
Now that we have more in this crate making use of traits, try to be more specific about what is actually unused.
2025-02-07fmaf128: fix exponent calculation for subnormalsTrevor Gross-12/+26
When `fmaf128` was introduced in [1], it included a bug where `self` gets returned rather than the expected minimum positive value. Resolve this and add a regression test. [1]: https://github.com/rust-lang/libm/pull/494
2025-02-07Check more subnormal values during edge cases testsTrevor Gross-2/+20
Add checks at the max subnormal value and a couple values scatted throughout the subnormal range. This helped identifiy a bug in `fmaf128`. As part of this, slightly reduce the amount of edge cases checked without optimizations because the change makes it become noticible.
2025-02-07Run standard tests before running integration testsTrevor Gross-0/+3
To ensure we don't waste time running extensive tests when there is an easily identifiable failure, run the normal test suite for relevant functions before starting extensive tests.
2025-02-06Revert vita's c_char back to i8Aphek-2/+6
2025-02-06Add better edge case testing for `scalbn`Trevor Gross-24/+101
Include integer values around the minimum and maximum exponents which require different behavior in the scale functions.
2025-02-06Add `fmaf128`Trevor Gross-67/+237
Resolve all remaining `f64`-specific items in the generic version of `fma`, then expose `fmaf128`.