about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-02-10Use io::const_error! when possible over io::Error::newThalia Archibald-15/+15
2025-02-10Increase allowed offset from infinity for ynfTrevor Gross-1/+1
Failed with called `Result::unwrap()` on an `Err` value: ynf Caused by: 0: input: (223, 116.89665) as hex: (, 0x1.d3962cp+6) as bits: (0x000000df, 0x42e9cb16) expected: -3.1836905e38 -0x1.df074cp+127 0xff6f83a6 actual: -inf -inf 0xff800000 1: mismatched infinities
2025-02-10Add `fminimum`, `fmaximum`, `fminimum_num`, and `fmaximum_num`Trevor Gross-31/+997
These functions represent new operations from IEEE 754-2019. Introduce them for all float sizes.
2025-02-10Combine `fmin{,f,f16,f128}` and `fmax{,f,f16,128}` into a single fileTrevor Gross-64/+65
These don't have much content since they now use the generic implementation. There will be more similar functions in the near future (fminimum, fmaximum, fminimum_num, fmaximum_num); start the pattern of combining similar functions now so we don't have to eventually maintain similar docs across 24 different files.
2025-02-10Small refactor of bigint testsTrevor Gross-31/+34
Print errors immediately rather than deferring to the end, so any debug output shows up immediately before the relevant failed test.
2025-02-10Auto merge of #136823 - matthiaskrgr:rollup-vp20mk1, r=matthiaskrgrbors-4/+4
Rollup of 6 pull requests Successful merges: - #136419 (adding autodiff tests) - #136628 (ci: upgrade to crosstool-ng 1.27.0) - #136681 (resolve `llvm-config` path properly on cross builds) - #136714 (Update `compiler-builtins` to 0.1.146) - #136731 (rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync") - #136791 (Disable DWARF in linker options for i686-unknown-uefi) Failed merges: - #136767 (improve host/cross target checking) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-10Reword doc comment on `CoercePointeeValidated`Michael Goulet-6/+5
2025-02-10Rollup merge of #136714 - tgross35:update-builtins, r=tgross35Matthias Krüger-4/+4
Update `compiler-builtins` to 0.1.146 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-10Auto merge of #135701 - calebzulawski:sync-from-portable-simd-2025-01-18, ↵bors-388/+865
r=workingjubilee Portable SIMD subtree update r? `@workingjubilee`
2025-02-10Implement `read*_exact` for `std:io::repeat`Benoît du Garreau-0/+11
cc #136756
2025-02-10Eliminate the use of `force_eval!` in `ceil`, `floor`, and `trunc`Trevor Gross-37/+220
2025-02-10Migrate away from nonfunctional `fenv` stubsTrevor Gross-141/+240
Many routines have some form of handling for rounding mode and floating point exceptions, which are implemented via a combination of stubs and `force_eval!` use. This is suboptimal, however, because: 1. Rust does not interact with the floating point environment, so most of this code does nothing. 2. The parts of the code that are not dead are not testable. 3. `force_eval!` blocks optimizations, which is unnecessary because we do not rely on its side effects. We cannot ensure correct rounding and exception handling in all cases without some form of arithmetic operations that are aware of this behavior. However, the cases where rounding mode is explicitly handled or exceptions are explicitly raised are testable. Make this possible here for functions that depend on `math::fenv` by moving the implementation to a nonpublic function that takes a `Round` and returns a `Status`. Link: https://github.com/rust-lang/libm/issues/480
2025-02-10Add `_value` methods to proc_macro libGuillaume Gomez-0/+123
2025-02-10Extract `unescape` from `rustc_lexer` into its own crateGuillaume Gomez-0/+738
2025-02-10Rollup merge of #136805 - RalfJung:miri-win-delete-self, r=NoratriebJubilee-0/+1
ignore win_delete_self test in Miri Follow-up to https://github.com/rust-lang/rust/pull/134679, fixes miri-test-libstd on Windows Cc `@ChrisDenton` `@Mark-Simulacrum`
2025-02-10Rollup merge of #136705 - compiler-errors:edition-library, r=jhprattJubilee-152/+156
Some miscellaneous edition-related library tweaks Some library edition tweaks that can be done separately from upgrading the whole standard library to edition 2024 (which is blocked on getting the submodules upgraded, for example)
2025-02-10Rollup merge of #136552 - ChrisDenton:option-find-handle, r=Mark-SimulacrumJubilee-10/+6
Use an `Option` for `FindNextFileHandle` in `ReadDir` instead of `INVALID_FILE_HANDLE` sentinel value Sometimes we store an invalid handle when we don't want to return an error. We then check the handle before use in order to avoid actually using the invalid handle. However, using an `Option` for this is better and avoids us forgetting to check the handle is valid. This was noticed due to us closing the handle without checking for validity: https://github.com/rust-lang/rust/blob/bd6a6777f5cbbec549f123995026cef76d1e6b84/library/std/src/sys/pal/windows/fs.rs#L148-L151
2025-02-10Rollup merge of #136353 - purplesyringa:libtest-instant-wasm, r=Mark-SimulacrumJubilee-2/+3
fix(libtest): Enable Instant on Emscripten targets `Instant::now()` works correctly on Emscripten since https://github.com/rust-lang/libc/pull/3962. All wasm-family targets with OS support can now handle instants. Improves #131738. ~~This changes the behavior of libtest on `unknown-unknown`/`unknown-none` wasm targets, but as far as I can see, libtest doesn't support them anyway. (Can anyone double-check?)~~ UPD: this patch no longer affects `unknown-unknown` targets. ``@rustbot`` label +A-libtest +T-testing-devex +O-emscripten +O-wasm -needs-triage
2025-02-10Rollup merge of #136228 - hkBst:patch-28, r=Mark-SimulacrumJubilee-3/+3
Simplify Rc::as_ptr docs + typo fix
2025-02-10Introduce a trait constant for the minimum positive normal valueTrevor Gross-0/+10
2025-02-10ignore win_delete_self test in MiriRalf Jung-0/+1
2025-02-09Implement `u256` with two `u128`s rather than `u64`Trevor Gross-188/+298
This produces better assembly, e.g. on aarch64: .globl libm::u128_wmul .p2align 2 libm::u128_wmul: Lfunc_begin124: .cfi_startproc mul x9, x2, x0 umulh x10, x2, x0 umulh x11, x3, x0 mul x12, x3, x0 umulh x13, x2, x1 mul x14, x2, x1 umulh x15, x3, x1 mul x16, x3, x1 adds x10, x10, x14 cinc x13, x13, hs adds x13, x13, x16 cinc x14, x15, hs adds x10, x10, x12 cinc x11, x11, hs adds x11, x13, x11 stp x9, x10, [x8] cinc x9, x14, hs stp x11, x9, [x8, rust-lang/libm#16] ret The original was ~70 instructions so the improvement is significant. With these changes, the result is reasonably close to what LLVM generates using `u256` operands [1]. [1]: https://llvm.godbolt.org/z/re1aGdaqY
2025-02-09ci: Pin the nightly toolchain for i686-pc-windows-gnuTrevor Gross-1/+2
Pin i686-pc-windows-gnu to nightly-2025-02-07 until [1] is resolved. [1]: https://github.com/rust-lang/rust/issues/136795
2025-02-09Increase the tolerance for `jn` and `yn`Trevor Gross-12/+14
These still fail random tests, e.g.: called `Result::unwrap()` on an `Err` value: jn Caused by: 0: input: (1068, -16013.98381387313) as hex: (, -0x1.f46fded9ced39p+13) as bits: (0x0000042c, 0xc0cf46fded9ced39) expected: 6.7603314308122506e-6 0x1.c5ad9c102d413p-18 0x3edc5ad9c102d413 actual: 6.7603314308006335e-6 0x1.c5ad9c1029e80p-18 0x3edc5ad9c1029e80 1: ulp 13715 > 4000 Caused by: 0: input: (195, 42147.94) as hex: (, 0x1.4947e2p+15) as bits: (0x000000c3, 0x4724a3f1) expected: -2.13669e-7 -0x1.cad9c6p-23 0xb4656ce3 actual: -2.1376937e-7 -0x1.cb10f4p-23 0xb465887a 1: ulp 7063 > 4000 Caused by: 0: input: (194, 740.1916) as hex: (, 0x1.721886p+9) as bits: (0x000000c2, 0x44390c43) expected: 1.212096e-6 0x1.455e9ap-20 0x35a2af4d actual: 1.2172386e-6 0x1.46c000p-20 0x35a36000 1: ulp 45235 > 10000 Increase allowed precision to avoid spurious failures.
2025-02-09Stabilize file_lockChristopher Berner-10/+5
2025-02-09Add .git-blame-ignore-revsEric Huss-0/+4
This will ignore certain commits in `git blame`
2025-02-09Format with style edition 2024Eric Huss-803/+228
2025-02-09fix(libtest): Enable Instant on Emscripten targetsAlisa Sireneva-2/+3
`Instant::now()` works correctly on Emscripten since https://github.com/rust-lang/libc/pull/3962. All wasm-family targets with OS support can now handle instants.
2025-02-10block coerce_pointee_validated for stabilizationDing Xiang Fei-1/+1
2025-02-09Update all crates to Rust 2024Eric Huss-11/+11
2025-02-09Update documentation for unsafe_op_in_unsafe_fnEric Huss-55/+57
For the documentation side, we probably want to show the Rust 2024 style.
2025-02-09Allow unsafe_op_in_unsafe_fnEric Huss-0/+5
Because stdarch has a really large number of unsafe functions with single-line calls, `unsafe_op_in_unsafe_fn` would end up adding a lot of noise, so for now we will allow it to migrate to 2024.
2025-02-09Apply unsafe_attr_outside_unsafeEric Huss-5/+5
2025-02-09Rollup merge of #135488 - GrigorenkoPV:vec_pop_if, r=jhprattMatthias Krüger-5/+1
Stabilize `vec_pop_if` Tracking issue: #122741 FCP completed in https://github.com/rust-lang/rust/issues/122741#issuecomment-2605116387
2025-02-09Apply rust_2024_incompatible_patEric Huss-2/+2
2025-02-09Apply keyword_idents_2024Eric Huss-1/+1
2025-02-09Apply missing_unsafe_on_externEric Huss-1116/+1116
2025-02-09Fix pattern matching mode changes and unsafe_op_in_unsafe_fnMichael Goulet-6/+10
2025-02-09Mark extern blocks as unsafeMichael Goulet-132/+132
2025-02-09Rename field in OnceWith from gen to makeMichael Goulet-7/+7
2025-02-09Mark link_section attr with unsafeMichael Goulet-7/+7
2025-02-09Update string.rsRobert Bastian-5/+2
2025-02-09Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrumbors-250/+292
Update bootstrap compiler and rustfmt The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same time.
2025-02-09Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgaubors-7/+53
Rollup of 5 pull requests Successful merges: - #134679 (Windows: remove readonly files) - #136213 (Allow Rust to use a number of libc filesystem calls) - #136530 (Implement `x perf` directly in bootstrap) - #136601 (Detect (non-raw) borrows of null ZST pointers in CheckNull) - #136659 (Pick the max DWARF version when LTO'ing modules with different versions ) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-09rename the trait to validity and place a feature gate afrontDing Xiang Fei-4/+13
2025-02-09introduce CoercePointeeWellformed for coherence checks at typeck stageDing Xiang Fei-0/+6
2025-02-08Rollup merge of #136724 - steffahn:asyncfn-non-fundamental, r=compiler-errorsJubilee-3/+0
Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]` Address the issue #136723 on nightly (the issue will only *actually* be fixed with a beta backport).
2025-02-08Rollup merge of #136710 - JakenHerman:jaken/iterator-docs, r=workingjubileeJubilee-1/+6
Document `Sum::sum` returns additive identities for `[]` 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. Relevant Commit: https://github.com/rust-lang/rust/commit/490818851860fb257e23fe7aa0ee32eaffc4ba40 Relevant Pull Request: https://github.com/rust-lang/rust/pull/129321 --- The referenced commit causes unintended side effects on presentation layer applications like using Tera templates, for example. I'm not sure what the motivation was behind the original change, but it seems like more discussion should be put into this issue and potentially have that change reverted.
2025-02-08Rollup merge of #136686 - bjoernager:master, r=jhprattJubilee-8/+8
Clean up `HashMap` and `HashSet` docs. This commit makes some small, pedantic changes to the docs for `HashMap` and `HashSet`, which fixes that: * "HashMap" is not always formatted as code (as in `HashMap`), and that * `HashSet` sometimes references `HashMap` instead of itself.
2025-02-09Rollup merge of #136601 - compiler-errors:borrow-null-zst, r=saethlinUrgau-1/+1
Detect (non-raw) borrows of null ZST pointers in CheckNull Fixes #136568. Ensures that we check that borrows of derefs are non-null in the `CheckNull` pass **even if** it's a ZST pointee. I'm actually surprised that this is UB in Miri, but if it's certainly UB, then this PR modifies the null check to be stricter. I couldn't find anywhere in https://doc.rust-lang.org/reference/behavior-considered-undefined.html that discusses this case specifically, but I didn't read it too closely, or perhaps it's just missing a bullet point. On the contrary, if this is actually erroneous UB in Miri, then I'm happy to close this (and perhaps fix the null check in Miri to exclude ZSTs?) On the double contrary, if this is still an "open question", I'm also happy to close this and wait for a decision to be made. r? ``@saethlin`` cc ``@RalfJung`` (perhaps you feel strongly about this change)