about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-05-28When replacing an old value we may not drop it in placeOrson Peters-12/+8
2025-05-28Add same unsafe bound on get_or_init_slowOrson Peters-2/+8
2025-05-28Add comments to diagnostic itemsPatrick-6-0/+6
2025-05-28Do not panic, maintain old behaviorOrson Peters-25/+17
2025-05-28Rollup merge of #140697 - Sa4dUs:split-autodiff, r=ZuseZ4Trevor Gross-14/+39
Split `autodiff` into `autodiff_forward` and `autodiff_reverse` This PR splits `#[autodiff]` macro so `#[autodiff(df, Reverse, args)]` would become `#[autodiff_reverse(df, args)]` and `#[autodiff(df, Forward, args)]` would become `#[autodiff_forwad(df, args)]`.
2025-05-28Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=AmanieuTrevor Gross-0/+33
Add data_ptr method to Mutex and RwLock Implementation of https://github.com/rust-lang/rust/issues/140368 / https://github.com/rust-lang/libs-team/issues/531. I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course. Unresolved questions: - Return a `LockResult` or not? - Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
2025-05-28core: unstably expose atomic_compare_exchange so stdarch can use itRalf Jung-1/+4
2025-05-28Make pthread Mutex internals less publicPatrick-6-1/+1
2025-05-28Add diagnostic items to sys::MutexPatrick-6-0/+6
2025-05-28Improve safety comment, double-drop is not relevant hereOrson Peters-3/+4
2025-05-28Do not move thread-locals before droppingOrson Peters-32/+52
2025-05-28Test(fs): Fix test_eq_windows_file_type for Windows 7Paul Mabileau-1/+23
Would otherwise fail on: ``` thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20: called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." } ``` This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-28UnsafePinned: also include the effects of UnsafeCellRalf Jung-22/+11
2025-05-28Revert "increase perf of charsearcher for single ascii characters"Jakub Beránek-32/+2
This reverts commit 245bf503e2a948ac98170516d11df632e85a948b.
2025-05-28Update `CmpResult` to use a pointer-sized return typeTrevor Gross-26/+48
As seen at [1], LLVM uses `long long` on LLP64 (to get a 64-bit integer matching pointer size) and `long` on everything else, with exceptions for AArch64 and AVR. Our current logic always uses an `i32`. This happens to work because LLVM uses 32-bit instructions to check the output on x86-64, but the GCC checks the full 64-bit register so garbage in the upper half leads to incorrect results. Update our return type to be `isize`, with exceptions for AArch64 and AVR. Fixes: https://github.com/rust-lang/compiler-builtins/issues/919 [1]: https://github.com/llvm/llvm-project/blob/0cf3c437c18ed27d9663d87804a9a15ff6874af2/compiler-rt/lib/builtins/fp_compare_impl.inc#L11-L27
2025-05-28float: Disable `total_cmp` sNaN tests for `f16`Trevor Gross-37/+40
There is an LLVM bug with lowering of basic `f16` operations that mean a round trip via `__extendhfsf2` and `__truncsfhf2` may happen for simple `abs` calls or bitcasts [1]. This is problematic because the round trip quiets signaling NaNs. For most operations this is acceptable, but it is causing `total_cmp` tests to fail unless optimizations are enabled. Disable `total_cmp` tests involving signaling NaNs until this issue is resolved. Fixes: https://github.com/rust-lang/rustc_codegen_cranelift/issues/1578 Fixes: https://github.com/rust-lang/rust/issues/141503 [1]: https://github.com/llvm/llvm-project/issues/104915
2025-05-28coretests: add abs() and copysign() tests, and remove now-unnecessary ui testRalf Jung-45/+56
2025-05-28coretests: simplify test_float macro to derive more things from the type nameRalf Jung-134/+102
2025-05-28Auto merge of #141668 - tgross35:rollup-03gg6lf, r=tgross35bors-0/+60
Rollup of 8 pull requests Successful merges: - rust-lang/rust#140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`) - rust-lang/rust#140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`) - rust-lang/rust#141252 (gvn: bail out unavoidable non-ssa locals in repeat) - rust-lang/rust#141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored) - rust-lang/rust#141551 (Make two transmute-related MIR lints into HIR lint) - rust-lang/rust#141591 (ci: fix llvm test coverage) - rust-lang/rust#141647 (Bump master `stage0` compiler) - rust-lang/rust#141659 (Add `Result::map_or_default` and `Option::map_or_default`) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-27Rollup merge of #141659 - tkr-sh:map-or-default, r=AmanieuTrevor Gross-0/+60
Add `Result::map_or_default` and `Option::map_or_default` Closes: https://github.com/rust-lang/rust/pull/138068 _This PR has been recreated because of the inactivity of the author (Cf. https://github.com/rust-lang/rust/pull/138068#issuecomment-2912412288)_
2025-05-27fix: code cleanup and renamingMadhav Madhusoodanan-54/+57
2025-05-27fix: moved common code (that required no architecture-specificMadhav Madhusoodanan-268/+243
modifications) outside the IntrinsicDefinition trait
2025-05-27fix: moved f16 formatting code to common moduleMadhav Madhusoodanan-10/+16
2025-05-27Fix: removed BaseIntrinsicTypeDefinition + code cleanupMadhav Madhusoodanan-152/+49
1. Removed default implementation of traits that are compulsorily implemented 2. Replaced BaseIntrinsicTypeDefinition with Deref<Target = IntrinsicType>
2025-05-27feat: merging changes related to f16 formattingMadhav Madhusoodanan-7/+105
2025-05-27moved more code generation functionality to `common`Madhav Madhusoodanan-286/+301
2025-05-27fix: aarch64_be issues wthin compilationMadhav Madhusoodanan-8/+11
2025-05-27feat: made constraint commonMadhav Madhusoodanan-113/+78
2025-05-27chore: file renamingMadhav Madhusoodanan-25/+24
2025-05-27code cleanupMadhav Madhusoodanan-23/+23
2025-05-27Added dynamic dispatch for easier management of `<arch>ArchitectureTest` structsMadhav Madhusoodanan-13/+16
2025-05-27moved the C compilation commands into a struct for easier handlingMadhav Madhusoodanan-55/+193
2025-05-27Removed aarch64-be specific execution command for rust test filesMadhav Madhusoodanan-23/+8
2025-05-27renamed `a64_only` data member in `Intrinsic` to `arch_tags`Madhav Madhusoodanan-4/+4
2025-05-27Added a macro to simplify <Arch>IntrinsicType definitionsMadhav Madhusoodanan-42/+59
2025-05-27introduced generic types and code refactorMadhav Madhusoodanan-640/+808
2025-05-27Updated `Argument::from_c` to remove `ArgPrep` specific argumentMadhav Madhusoodanan-7/+31
2025-05-27added target field within `IntrinsicType` to perform target level checking ↵Madhav Madhusoodanan-12/+26
cleanly
2025-05-27test commit to check if `load_Values_c` can be dissociated from target logicMadhav Madhusoodanan-24/+32
2025-05-27rename struct for naming consistencyMadhav Madhusoodanan-4/+6
2025-05-27maintaining special list of targets which need different execution commandMadhav Madhusoodanan-5/+11
2025-05-27fixed `too many files open` issueMadhav Madhusoodanan-24/+36
2025-05-27chore: added match block in `src/main.rs`Madhav Madhusoodanan-2/+13
2025-05-27chore: code consolidationMadhav Madhusoodanan-162/+145
2025-05-27chore: separated common logic within file creations, compile_c, compile_rust ↵Madhav Madhusoodanan-397/+501
and compare_outputs
2025-05-27chore: Added `ProcessedCli` to extract the logic to pre-process CLI struct argsMadhav Madhusoodanan-608/+685
2025-05-27Chore: Added `SupportedArchitectureTest` trait which must be implemented for ↵Madhav Madhusoodanan-44/+60
different architectures. Next steps: Move the existing ARM-specific implementation into one that fits well with this trait.
2025-05-27Feat: Moved majority of the code to `arm` module.Madhav Madhusoodanan-767/+687
Reasoning: 1. Majority of code assumes the usage of `Intrinsic` and related types, which is derived from the JSON structure of the ARM intrinsics JSON source file 2. Further commits will start with extracting common parts of the code (eg: Create C/Rust file, Build C/Rust file, etc)
2025-05-27Auto merge of #129658 - saethlin:spare-a-crumb, r=jhprattbors-53/+86
Add some track_caller info to precondition panics Currently, when you encounter a precondition check, you'll always get the caller location of the implementation of the precondition checks. But with this PR, you'll be told the location of the invalid call. Which is useful. I thought of this while looking at https://github.com/rust-lang/rust/pull/129642#issuecomment-2311703898. The changes to `tests/ui/const*` happen because the const-eval interpreter skips `#[track_caller]` frames in its backtraces. The perf implications of this are: * Increased debug binary sizes. The caller_location implementation requires that the additional data we want to display here be stored in const allocations, which are deduplicated but not across crates. There is no impact on optimized build sizes. The panic path and the caller location data get optimized out. * The compile time hit to opt-incr-patched bitmaps happens because the patch changes the line number of some function calls with precondition checks, causing us to go from 0 dirty CGUs to 1 dirty CGU. * The other compile time hits are marginal but real, and due to doing a handful of new queries. Adding more useful data isn't completely free.
2025-05-27Rollup merge of #141312 - cberner:filelock_from, r=joshtriplettMatthias Krüger-8/+40
Add From<TryLockError> for io::Error Adds a `From` impl to make error propagation easier, as discussed in the tracking issue `TryLockError` is unstable under the "file_lock" feature. The related tracking issue is https://github.com/rust-lang/rust/issues/130994 This PR also cleanups the Windows implementation of `try_lock()` and `try_lock_shared()` as [discussed here](https://github.com/rust-lang/rust/pull/140718#discussion_r2076678485)