about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-01-14Update ReadDir::next in std::sys::pal::unix::fs to use `&raw const ↵Zachary S-23/+13
(*ptr).field` instead of `ptr.offset(...).cast()`. Also, the macro is only called three times, and all with the same local variable entry_ptr, so just use the local variable directly, and rename the macro to entry_field_ptr.
2025-01-15Update compiler-builtins to 0.1.143Trevor Gross-4/+4
0.1.142 fixes an issue parsing optimization flags, and 0.1.143 changes `__rust_[ui]128_*` builtins to use a C-safe signature.
2025-01-14Rollup merge of #135423 - compiler-errors:enforce-const-trait-syntactical, ↵Jubilee-0/+6
r=oli-obk,RalfJung Enforce syntactical stability of const traits in HIR This PR enforces what I'm calling *syntactical* const stability of traits. In other words, it enforces the ability to name `~const`/`const` traits in trait bounds in various syntax positions in HIR (including in the trait of an impl header). This functionality is analogous to the *regular* item stability checker, which is concerned with making sure that you cannot refer to unstable items by name, and is implemented as an extension of that pass. This is separate from enforcing the *recursive* const stability of const trait methods, which is implemented in MIR and runs on MIR bodies. That will require adding a new `NonConstOp` to the const checker and probably adjusting some logic to deduplicate redundant errors. However, this check is separate and necessary for making sure that users don't add `~const`/`const` bounds to items when the trait is not const-stable in the first place. I chose to separate enforcing recursive const stability out of this PR to make it easier to review. I'll probably open a follow-up following this one, blocked on this PR. r? `@RalfJung` cc `@rust-lang/project-const-traits`
2025-01-15chore: release v0.1.143github-actions[bot]-1/+7
2025-01-14Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsicsTrevor Gross-24/+39
Most of our Rust-specific overflowing intrinsics currently return `(i128, bool)`, which is not guaranteed to have a stable ABI. Switch to returning the overflow via a mutable parameter and only directly returning the integer result. `__rust_i128_mulo` now matches the function signature of `__muloti4`, but they do not share the same ABI on Windows so we cannot easily deduplicate them.
2025-01-15Add an override for a recent failureTrevor Gross-0/+7
Failed on i686: ──── STDERR: libm-test::bench/random y1f/crate thread 'main' panicked at crates/libm-test/benches/random.rs:76:65: called `Result::unwrap()` on an `Err` value: ynf Caused by: 0: input: (213, 109.15641) (0x000000d5, 0x42da5015) expected: -3.3049217e38 0xff78a27a actual: -inf 0xff800000 1: mismatched infinities
2025-01-15Pass --max-fail to nextest so it doesn't fail fastTrevor Gross-1/+1
2025-01-15Slightly restructure `ci/calculate-exhaustive-matrix.py`Trevor Gross-7/+26
Change this script into a generic CI utility that we will be able to expand in the future.
2025-01-14Enforce syntactical stability of const traits in HIRMichael Goulet-0/+6
2025-01-14Update compiler-builtins to 0.1.141Trevor Gross-4/+4
0.1.141 syncs changes from `libm`. Most of the `libm` changes are testing- or configuration-related.
2025-01-14wasi/io: remove dead filesRalf Jung-29/+4
2025-01-14remove unnecessary rustc_allowed_through_unstable_modulesRalf Jung-5/+0
2025-01-14remove pointless allowed_through_unstable_modules on TryFromSliceErrorRalf Jung-1/+0
2025-01-14remove Rustc{En,De}codable from library and compilerRalf Jung-44/+0
2025-01-14make rustc_encodable_decodable feature properly unstableRalf Jung-8/+4
2025-01-14add comments explaining main thread identificationjoboet-0/+29
2025-01-14std: lazily allocate the main thread handlejoboet-114/+151
Thereby, we also allow accessing thread::current before main: as the runtime no longer tries to install its own handle, this will no longer trigger an abort. Rather, the name returned from name will only be "main" after the runtime initialization code has run, but I think that is acceptable. This new approach also requires some changes to the signal handling code, as calling `thread::current` would now allocate when called on the main thread, which is not acceptable. I fixed this by adding a new function (`with_current_name`) that performs all the naming logic without allocation or without initializing the thread ID (which could allocate on some platforms).
2025-01-14Revert "Remove the Arc rt::init allocation for thread info"joboet-118/+54
This reverts commit 0747f2898e83df7e601189c0f31762e84328becb.
2025-01-14Auto merge of #135473 - matthiaskrgr:rollup-ksnst4l, r=matthiaskrgrbors-3/+13
Rollup of 3 pull requests Successful merges: - #135381 (Add an example for `Vec::splice` inserting elements without removing) - #135451 (Remove code duplication when hashing query result and interning node) - #135464 (fix ICE with references to infinite structs in consts) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-14Rollup merge of #135381 - cod10129:vec-splice-doc, r=tgross35Matthias Krüger-3/+13
Add an example for `Vec::splice` inserting elements without removing This example clearly showcases how `splice` can be used to insert multiple elements efficiently at an index into a vector. Fixes #135369. The added example: > Using `splice` to insert new items into a vector efficiently at a specific position indicated by an empty range: > ```rust > let mut v = vec![1, 5]; > let new = [2, 3, 4]; > v.splice(1..1, new); > assert_eq!(v, [1, 2, 3, 4, 5]); > ``` `@rustbot` label A-docs A-collections
2025-01-14Auto merge of #135359 - RalfJung:lang-start-unwind, r=joboetbors-17/+30
use a single large catch_unwind in lang_start I originally planned to use `abort_unwind` but reading the comment in `thread_cleanup` it seems we are deliberately going for slightly nicer error messages here, so this preserves that. It still seems nice to not repeat `catch_unwind` so often.
2025-01-14Change `.yml` files to the canonical extension `.yaml`Trevor Gross-0/+0
2025-01-14Auto merge of #135465 - jhpratt:rollup-7p93bct, r=jhprattbors-7/+16
Rollup of 10 pull requests Successful merges: - #134498 (Fix cycle error only occurring with -Zdump-mir) - #134977 (Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion) - #135390 (Re-added regression test for #122638) - #135393 (uefi: helpers: Introduce OwnedDevicePath) - #135440 (rm unnecessary `OpaqueTypeDecl` wrapper) - #135441 (Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024) - #135444 (Update books) - #135450 (Fix emscripten-wasm-eh with unwind=abort) - #135452 (bootstrap: fix outdated feature name in comment) - #135454 (llvm: Allow sized-word rather than ymmword in tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-13Use cargo-nextest for running tests in CITrevor Gross-24/+48
The test suite for this repo has quite a lot of tests, and it is difficult to tell which contribute the most to the long CI runtime. libtest does have an unstable flag to report test times, but that is inconvenient to use because it needs to be passed only to libtest binaries. Switch to cargo-nextest [1] which provides time reporting and, overall, a better test UI. It may also improve test runtime, though this seems unlikely since we have larger test binaries with many small tests (nextest benefits the most when there are larger binaries that can be run in parallel). For anyone running locally without, `run.sh` should still fall back to `cargo test` if `cargo-nextest` is not available. This diff includes some cleanup and consistency changes to other CI-related files. [1]: https://nexte.st
2025-01-14Simplify and optimize `fdim` (#442)quaternic-9/+1
The cases with NaN arguments can be handled by the same x - y expression, and this generates much better code: https://godbolt.org/z/f3rnT8jx4.
2025-01-13Rollup merge of #135393 - Ayush1325:uefi-helper-path, r=thomccJacob Pratt-7/+16
uefi: helpers: Introduce OwnedDevicePath This PR is split off from #135368 to reduce noise. No real functionality changes, just some quality of life improvements. Also implement Debug for OwnedDevicePath for some quality of life improvements.
2025-01-13Add another `Vec::splice` examplecod10129-3/+13
Add an example for using splice to insert multiple elements efficiently into a vector.
2025-01-13Reduce indentation in `run.sh` using early returnTrevor Gross-23/+24
2025-01-13Don't set `codegen-units=1` by default in CITrevor Gross-3/+4
We can set this only for the release profile, there isn't any reason to have it set for debug tests.
2025-01-13uefi: helpers: Introduce OwnedDevicePathAyush Singh-7/+16
This PR is split off from #135368 to reduce noise. Rename DevicePath to OwnedDevicePath. This is to allow a non-owning version of DevicePath in the future to work with UEFI shell APIs which provide const pointers to device paths for UEFI shell fs mapping. Also implement Debug for OwnedDevicePath for some quality of life improvements. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13further improve panic_immediate_abort by removing rtprintpanic messagesklensy-0/+5
2025-01-13Rollup merge of #135405 - Ayush1325:path-is-absolute, r=tgross35Matthias Krüger-11/+27
path: Move is_absolute check to sys::path I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1]. This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not. I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases. [0]: https://github.com/rust-lang/rust/pull/135368 [1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137
2025-01-13Add `fdimf16` and `fdimf128`Trevor Gross-8/+93
Use the generic algorithms to provide implementations for these routines.
2025-01-13Add a generic version of `fdim`Trevor Gross-24/+21
2025-01-13Format the MPFR manual implementation listTrevor Gross-7/+41
2025-01-13Disable `util` and `libm-macros` for optimized testsTrevor Gross-1/+7
These crates take time building in CI, especially with the release profile having LTO enabled, but there isn't really any reason to test them with different features or in release mode. Disable this to save some CI runtime.
2025-01-13Add `truncf16` and `truncf128`Trevor Gross-5/+61
Use the generic algorithms to provide implementations for these routines.
2025-01-13Add a generic version of `trunc`Trevor Gross-51/+59
The algorithm is identical for both types, so this is a straightforward routine to port.
2025-01-13Add a utility crate for quick evaluationTrevor Gross-0/+298
Introduce a simple binary that can run arbitrary input against any of the available implementations (musl, MPFR, our libm). This provides an easy way to check results, or run specific cases against a debugger. Examples: $ cargo run -p util -- eval libm pow 1.6 2.4 3.089498284311124 $ cargo run -p util -- eval mpfr pow 1.6 2.4 3.089498284311124 $ cargo run -p util -- eval musl tgamma 1.2344597839132 0.9097442657960874 $ cargo run -p util -- eval mpfr tgamma 1.2344597839132 0.9097442657960874 $ cargo run -p util -- eval libm tgamma 1.2344597839132 0.9097442657960871 $ cargo run -p util -- eval musl sincos 3.1415926535 (8.979318433952318e-11, -1.0)
2025-01-13path: Move is_absolute check to sys::pathAyush Singh-11/+27
I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1]. This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not. I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases. [0]: https://github.com/rust-lang/rust/pull/135368 [1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13Enable `build-mpfr` and `build-musl` by defaultTrevor Gross-23/+22
Most users who are developing this crate are likely running on a Unix system, since there isn't much to test against otherwise. For convenience, enable the features required to run these tests by default.
2025-01-13Rename the `test-multiprecision` feature to `build-mpfr`Trevor Gross-14/+14
Currently the features that control what we test against are `build-musl` and `test-multiprecision`. I didn't name them very consistently and there isn't really any reason for that. Rename `test-multiprecision` to `build-mpfr` to better reflect what it actually does and to be more consistent with `build-musl`.
2025-01-12Auto merge of #135420 - GuillaumeGomez:rollup-93vepka, r=GuillaumeGomezbors-2/+2
Rollup of 7 pull requests Successful merges: - #135348 (rustdoc-json: Include items in stripped modules in `Crate::paths`.) - #135365 (Update the explanation for why we use box_new in vec!) - #135383 (De-abstract tagged ptr and make it covariant) - #135401 (Remove some empty expected files to fix blessing) - #135406 (Update unstable lint docs to include required feature attributes) - #135407 (Deny various clippy lints) - #135411 (run_make_support: add `#![warn(unreachable_pub)]`) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Auto merge of #135384 - saethlin:inline-copy-from-slice, r=joboetbors-0/+1
Add #[inline] to copy_from_slice I'm doing cooked things to CGU partitioning for compiler-builtins (https://github.com/rust-lang/rust/pull/135395) and this was the lone symbol in my compiler-builtins rlib that wasn't an intrinsic. Adding `#[inline]` makes it go away. Perf report indicates a marginal but chaotic effect on compile time, marginal improvement in codegen. As expected.
2025-01-12Update the explanation for why we use box_new in vec!Ben Kimock-2/+2
2025-01-12Auto merge of #135402 - matthiaskrgr:rollup-cz7hs13, r=matthiaskrgrbors-309/+411
Rollup of 6 pull requests Successful merges: - #129259 (Add inherent versions of MaybeUninit methods for slices) - #135374 (Suggest typo fix when trait path expression is typo'ed) - #135377 (Make MIR cleanup for functions with impossible predicates into a real MIR pass) - #135378 (Remove a bunch of diagnostic stashing that doesn't do anything) - #135397 (compiletest: add erroneous variant to `string_enum`s conversions error) - #135398 (add more crash tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Omit some more `From` impls to avoid inference failuresJosh Triplett-87/+80
2025-01-12Introduce arch::aarch64 and use it for rint{,f}Hanna Kruppe-2/+50
2025-01-12Use wasm32 arch intrinsics for rint{,f}Hanna Kruppe-1/+25
2025-01-12Add a new precision adjustment for i586 `exp2f`Trevor Gross-0/+9
There was a recent failure from the random tests: ---- mp_random_exp2f stdout ---- Random Mpfr exp2f arg 1/1: 10000 iterations (10000 total) using `LIBM_SEED=fqgMuzs6eqH1VZSEmQpLnThnaIyRUOWe` thread 'mp_random_exp2f' panicked at crates/libm-test/tests/multiprecision.rs:41:49: called `Result::unwrap()` on an `Err` value: input: (127.97238,) (0x42fff1dc,) expected: 3.3383009e38 0x7f7b2556 actual: inf 0x7f800000 Caused by: mismatched infinities Add an xfail for mismatched infinities on i586.