about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-08-08Auto merge of #145126 - tgross35:rollup-6w87usd, r=tgross35bors-62/+57
Rollup of 8 pull requests Successful merges: - rust-lang/rust#139451 (Add `target_env = "macabi"` and `target_env = "sim"`) - rust-lang/rust#144039 (Use `tcx.short_string()` in more diagnostics) - rust-lang/rust#144192 (atomicrmw on pointers: move integer-pointer cast hacks into backend) - rust-lang/rust#144545 (In rustc_pattern_analysis, put `true` witnesses before `false` witnesses) - rust-lang/rust#144579 (Implement declarative (`macro_rules!`) attribute macros (RFC 3697)) - rust-lang/rust#144649 (Account for bare tuples and `Pin` methods in field searching logic) - rust-lang/rust#144775 (more strongly dissuade use of `skip_binder`) - rust-lang/rust#144987 (Enable f16 and f128 on targets that were fixed in LLVM21) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-08Rollup merge of #144192 - RalfJung:atomicrmw-ptr, r=nikicTrevor Gross-62/+57
atomicrmw on pointers: move integer-pointer cast hacks into backend Conceptually, we want to have atomic operations on pointers of the form `fn atomic_add(ptr: *mut T, offset: usize, ...)`. However, LLVM does not directly support such operations (https://github.com/llvm/llvm-project/issues/120837), so we have to cast the `offset` to a pointer somewhere. This PR moves that hack into the LLVM backend, so that the standard library, intrinsic, and Miri all work with the conceptual operation we actually want. Hopefully, one day LLVM will gain a way to represent these operations without integer-pointer casts, and then the hack will disappear entirely. Cc ```@nikic``` -- this is the best we can do right now, right? Fixes https://github.com/rust-lang/rust/issues/134617
2025-08-08Revert "Rollup merge of #143906 - ↵Jakub Beránek-35/+35
LorrensP-2158466:miri-float-nondet-foreign-items, r=RalfJung" This reverts commit 71f04692c32e181ab566c01942f1418dec8662d4, reversing changes made to 995ca3e532b48b689567533e6b736675e38b741e.
2025-08-08Fix wasm target build with atomics featureSpxg-0/+4
2025-08-08Auto merge of #145077 - Zalathar:rollup-0k4194x, r=Zalatharbors-5012/+5347
Rollup of 19 pull requests Successful merges: - rust-lang/rust#144400 (`tests/ui/issues/`: The Issues Strike Back [3/N]) - rust-lang/rust#144764 ([codegen] assume the tag, not the relative discriminant) - rust-lang/rust#144807 (Streamline config in bootstrap) - rust-lang/rust#144899 (Print CGU reuse statistics in `-Zprint-mono-items`) - rust-lang/rust#144909 (Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information) - rust-lang/rust#144912 (Resolver: introduce a conditionally mutable Resolver for (non-)speculative resolution.) - rust-lang/rust#144914 (Add support for `ty::Instance` path shortening in diagnostics) - rust-lang/rust#144931 ([win][arm64ec] Fix msvc-wholearchive for Arm64EC) - rust-lang/rust#144999 (coverage: Remove all unstable support for MC/DC instrumentation) - rust-lang/rust#145009 (A couple small changes for rust-analyzer next-solver work) - rust-lang/rust#145030 (GVN: Do not flatten derefs with ProjectionElem::Index. ) - rust-lang/rust#145042 (stdarch subtree update) - rust-lang/rust#145047 (move `type_check` out of `compute_regions`) - rust-lang/rust#145051 (Prevent name collisions with internal implementation details) - rust-lang/rust#145053 (Add a lot of NLL `known-bug` tests) - rust-lang/rust#145055 (Move metadata symbol export from exported_non_generic_symbols to exported_symbols) - rust-lang/rust#145057 (Clean up some resolved test regressions of const trait removals in std) - rust-lang/rust#145068 (Readd myself to review queue) - rust-lang/rust#145070 (Add minimal `armv7a-vex-v5` tier three target) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-08Fix wrong cache line size of riscv64minxuanz-5/+3
2025-08-08Rollup merge of #145057 - ShoyuVanilla:const-trait-tests-cleanup, r=petrochenkovStuart Cook-10/+2
Clean up some resolved test regressions of const trait removals in std cc rust-lang/rust#143871
2025-08-08Rollup merge of #145042 - heiher:stdarch-push, r=folkertdevStuart Cook-4991/+5269
stdarch subtree update Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/97bf36dac05befe0a9503a7bf5a35a1b3d8d5604. Created using https://github.com/rust-lang/josh-sync. r? `@folkertdev`
2025-08-08Rollup merge of #144909 - GuillaumeGomez:extend-libtest-for-merged-doctests, ↵Stuart Cook-11/+76
r=Amanieu Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information This PR is the first commit of https://github.com/rust-lang/rust/pull/144908. Sadly, it seems like we can't do all of it at once... r? ``@Amanieu``
2025-08-07Hoist zero and one out into TestableFloatRoger Curley-88/+72
2025-08-07Consolidate total_cmp testsRoger Curley-578/+166
This standardizes how max and min subnormals are generated. Since the new method doesn't use powf, it also enables some of the tests for f128 that were previously disabled due to issues with powf (although it looks like those issues were already fixed anyway). f16 signalling nan tests previously disabled are not re-enabled, since the underlying LLVM issue has not been closed.
2025-08-07Consolidate clamp testsRoger Curley-72/+45
2025-08-07Consolidate sqrt_domain testsRoger Curley-48/+23
2025-08-07Consolidate test_next_downRoger Curley-183/+34
2025-08-07Consolidate test_next_upRoger Curley-119/+69
Note that the behaviour of the f128 test is slightly changed to use the same nan mask as is used in test_float_bits_conv, which is the behaviour used by f16,f32,and f64.
2025-08-07Consolidate is_sign_negative testsRoger Curley-52/+21
2025-08-07Consolidate is_positive testsRoger Curley-52/+21
2025-08-07Consolidate signum testsRoger Curley-24/+20
2025-08-07Consolidate abs testsRoger Curley-53/+9
This clobbers the existing generic abs test, but it covers strictly more, so that seems fine.
2025-08-07Rollup merge of #145046 - ulrichstark:master, r=tgross35Trevor Gross-2/+2
Fix doc comment of File::try_lock and File::try_lock_shared The doc comments of functions `File::try_lock` and `File::try_lock_shared` stabilized today in version 1.89.0 document an incorrect type of `Ok`. The result type was changed in rust-lang/rust#139343 after the latest change to the doc comments in rust-lang/rust#136876.
2025-08-07Rollup merge of #145045 - Hywan:doc-library-iterator-by_ref, r=GuillaumeGomezTrevor Gross-1/+1
doc(library): Fix Markdown in `Iterator::by_ref` This patch fixes the Markdown formatting in `std::core::iter::Iterator::by_ref`. Code is used inside a link without the backticks around the code.
2025-08-07Rollup merge of #144974 - tgross35:update-builtins, r=tgross35Trevor Gross-533/+464
compiler-builtins subtree update Subtree update of `compiler-builtins` to https://github.com/rust-lang/compiler-builtins/commit/87a66ec9699e5ddf2c660277b8078099efd01311. Created using https://github.com/rust-lang/josh-sync. r? ``@ghost``
2025-08-07Rollup merge of #144903 - Kivooeo:panic_handler-is-not-begin, r=m-ou-seTrevor Gross-1/+1
Rename `begin_panic_handler` to `panic_handler` Part of https://github.com/rust-lang/rust/issues/116005
2025-08-07Rollup merge of #144900 - Kivooeo:unsigned_signed_diff-stabilize, r=dtolnayTrevor Gross-3/+2
Stabilize `unsigned_signed_diff` feature This closes [tracking issue](https://github.com/rust-lang/rust/issues/126041) and stabilises `checked_signed_diff` Closes: https://github.com/rust-lang/rust/issues/126041
2025-08-07Rollup merge of #144705 - pmur:murp/aarch64-lse, r=AmanieuTrevor Gross-10/+93
compiler-builtins: plumb LSE support for aarch64 on linux/gnu when optimized-compiler-builtins not enabled Add dynamic support for aarch64 LSE atomic ops on linux/gnu targets when optimized-compiler-builtins is not enabled. Enabling LSE is the primary motivator for rust-lang/rust#143689, though extending the rust version doesn't seem too farfetched. Are there more details which I have overlooked which make this impractical? I've tested this on an aarch64 host with LSE. r? ```````@tgross35```````
2025-08-07Start runnning tests for aarch64-pc-windows-msvcTrevor Gross-2/+1
This target is currently build-only. Switch to the windows-11-arm runner, which allows us to start running tests.
2025-08-07Remove instances of `allow(improper_ctypes)`Trevor Gross-5/+0
i128/u128 haven't flagged `improper_ctypes` for a while, and this just made it to stable [1]. Remove the `allow`s as they are no longer needed. [1]: https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#i128-and-u128-in-extern-c-functions
2025-08-08Clean up some resolved test regressions of const trait removals in stdShoyu Vanilla-10/+2
2025-08-07Auto merge of #145043 - Zalathar:rollup-3dbvdrm, r=Zalatharbors-124/+252
Rollup of 19 pull requests Successful merges: - rust-lang/rust#137831 (Tweak auto trait errors) - rust-lang/rust#138689 (add nvptx_target_feature) - rust-lang/rust#140267 (implement continue_ok and break_ok for ControlFlow) - rust-lang/rust#143028 (emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching) - rust-lang/rust#143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order) - rust-lang/rust#143808 (Port `#[should_panic]` to the new attribute parsing infrastructure ) - rust-lang/rust#143906 (Miri: non-deterministic floating point operations in `foreign_items`) - rust-lang/rust#143929 (Mark all deprecation lints in name resolution as deny-by-default and report-in-deps) - rust-lang/rust#144133 (Stabilize const TypeId::of) - rust-lang/rust#144369 (Upgrade semicolon_in_expressions_from_macros from warn to deny) - rust-lang/rust#144439 (Introduce ModernIdent type to unify macro 2.0 hygiene handling) - rust-lang/rust#144473 (Address libunwind.a inconsistency issues in the bootstrap program) - rust-lang/rust#144601 (Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`) - rust-lang/rust#144650 (Additional tce tests) - rust-lang/rust#144659 (bootstrap: refactor mingw dist and fix gnullvm) - rust-lang/rust#144682 (Stabilize `strict_overflow_ops`) - rust-lang/rust#145026 (Update books) - rust-lang/rust#145033 (Reimplement `print_region` in `type_name.rs`.) - rust-lang/rust#145040 (rustc-dev-guide subtree update) Failed merges: - rust-lang/rust#143857 (Port #[macro_export] to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-07Fix doc comment of File::try_lock and File::try_lock_sharedUlrich Stark-2/+2
2025-08-07doc(library): Fix Markdown in `Iterator::by_ref`.Ivan Enderlin-1/+1
This patch fixes the Markdown formatting in `std::core::iter::Iterator::by_ref`. Code is used inside a link without the backticks around the code.
2025-08-07Auto merge of #144997 - BoxyUwU:bootstrap_bump, r=Mark-Simulacrumbors-153/+153
bump bootstrap compiler to 1.90 beta There were significantly less `cfg(bootstrap)` and `cfg(not(bootstrap))` this release. Presumably due to the fact that we change the bootstrap stage orderings to reduce the need for them and it was successful :pray:
2025-08-07Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-SimulacrumStuart Cook-87/+54
Stabilize `strict_overflow_ops` Closes rust-lang/rust#118260
2025-08-07Rollup merge of #144133 - oli-obk:stabilize-const-type-id, r=lcnrStuart Cook-2/+2
Stabilize const TypeId::of fixes rust-lang/rust#77125 # Stabilization report for `const_type_id` ## General design ### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized? N/A the constness was never RFCed ### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con. `const_type_id` was kept unstable because we are currently unable to stabilize the `PartialEq` impl for it (in const contexts), so we feared people would transmute the type id to an integer and compare that integer. ### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those? `TypeId::eq` is not const at this time, and will only become const once const traits are stable. ## Has a Call for Testing period been conducted? If so, what feedback was received? This feature has been unstable for a long time, and most people just worked around it on stable by storing a pointer to `TypeId::of` and calling that at "runtime" (usually LLVM devirtualized the function pointer and inlined the call so there was no real performance difference). A lot of people seem to be using the `const_type_id` feature gate (600 results for the feature gate on github: https://github.com/search?q=%22%23%21%5Bfeature%28const_type_id%29%5D%22&type=code) We have had very little feedback except desire for stabilization being expressed. ## Implementation quality Until these three PRs * https://github.com/rust-lang/rust/pull/142789 * https://github.com/rust-lang/rust/pull/143696 * https://github.com/rust-lang/rust/pull/143736 there was no difference between the const eval feature and the runtime feature except that we prevented you from using `TypeId::of` at compile-time. These three recent PRs have hardened the internals of `TypeId`: * it now contains an array of pointers instead of integers * these pointers at compile-time (and in miri) contain provenance that makes them unique and prevents inspection. Both miri and CTFE will in fact error if you mess with the bits or the provenance of the pointers in any way and then try to use the `TypeId` for an equality check. This also guards against creating values of type `TypeId` by any means other than `TypeId::of` ### Summarize the major parts of the implementation and provide links into the code (or to PRs) N/A see above ### Summarize existing test coverage of this feature Since we are not stabilizing any operations on `TypeId` except for creating `TypeId`s, the test coverage of the runtime implementation of `TypeId` covers all the interesting use cases not in the list below #### Hardening against transmutes * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id.rs * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id2.rs * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id3.rs * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id4.rs * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_transmute_type_id5.rs #### TypeId::eq is still unstable * https://github.com/rust-lang/rust/blob/master/tests/ui/consts/const_cmp_type_id.rs ### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking? https://github.com/rust-lang/rust/issues/129014 is still unresolved, but it affects more the runtime version of `TypeId` than the compile-time. ### What FIXMEs are still in the code for that feature and why is it ok to leave them there? none ### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization * `@eddyb` * `@RalfJung` ### Which tools need to be adjusted to support this feature. Has this work been done? N/A ## Type system and execution rules ### What compilation-time checks are done that are needed to prevent undefined behavior? Already covered above. Transmuting types with private fields to expose those fields has always been library UB, but for the specific case of `TypeId` CTFE and Miri will detect it if that is done in any way other than for reconstructing the exact same `TypeId` in another location. ### Does the feature's implementation need checks to prevent UB or is it sound by default and needs opt in in places to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale? N/A ### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.) N/A ### What updates are needed to the reference/specification? (link to PRs when they exist) Nothing more than what needs to exist for `TypeId` already. ## Common interactions ### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries? N/A ### What other unstable features may be exposed by this feature? N/A
2025-08-07Rollup merge of #143906 - LorrensP-2158466:miri-float-nondet-foreign-items, ↵Stuart Cook-35/+35
r=RalfJung Miri: non-deterministic floating point operations in `foreign_items` Part of [rust-lang/miri/#3555](https://github.com/rust-lang/miri/issues/3555#issue-2278914000), this pr does the `foreign_items` work. Some things have changed since rust-lang/rust#138062 and rust-lang/rust#142514. I moved the "helpers" used for creating fixed outputs and clamping operations to their defined ranges to `math.rs`. These are now also extended to handle the floating-point operations in `foreign_items`. Tests in `miri/tests/float.rs` were changed/added. Failing tests in `std` were extracted, run under miri with `-Zmiri-many-seeds=0..1000` and changed accordingly. Double checked with `-Zmiri-many-seeds`. I noticed that the C standard doesn't specify the output ranges for all of its mathematical operations; it just specifies them as: ``` Returns The sinh functions return sinh x. ``` So I used [Wolfram|Alpha](https://www.wolframalpha.com/).
2025-08-07Rollup merge of #140267 - jogru0:control_flow, r=dtolnayStuart Cook-0/+160
implement continue_ok and break_ok for ControlFlow Tracking issue: https://github.com/rust-lang/rust/issues/140266 r? ``````@dtolnay``````
2025-08-07Rollup merge of #138689 - jedbrown:jed/nvptx-target-feature, r=ZuseZ4Stuart Cook-0/+1
add nvptx_target_feature Tracking issue: #141468 (nvptx), which is part of #44839 (catch-all arches) The feature gate is `#![feature(nvptx_target_feature)]` This exposes the target features `sm_20` through `sm_120a` [as defined](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.1/llvm/lib/Target/NVPTX/NVPTX.td#L59-L85) by LLVM. Cc: ``````@gonzalobg`````` ``````@rustbot`````` label +O-NVPTX +A-target-feature
2025-08-07symcheck: Ignore symbols in `.debug_gdb_scripts`Trevor Gross-0/+5
Since [1], our object files may now contain a GDB script section. These symbols wind up with multiple instances in the archive but are weak, so we can safely ignore them in our duplicates check. This resolves the current CI failures. [1]: https://github.com/rust-lang/rust/pull/143679
2025-08-07symcheck: Store the section name in `SymInfo` if availableTrevor Gross-10/+20
Currently `SymInfo` stores a `Section`, which is just an index: SymInfo { section: Section( SectionIndex( 539, ), ), ... }, Look up and store the section name instead if possible, with a fallback to the `Section` debug printing. This makes output more clear and will allow us to filter by section name.
2025-08-07Auto merge of #115746 - tgross35:unnamed-threads-panic-message, r=cuviperbors-7/+127
Print thread ID in panic message `panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (12345) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print. try-job: aarch64-apple try-job: aarch64-gnu try-job: dist-apple-various try-job: dist-various-* try-job: dist-x86_64-freebsd try-job: dist-x86_64-illumos try-job: dist-x86_64-netbsd try-job: dist-x86_64-solaris try-job: test-various try-job: x86_64-gnu try-job: x86_64-mingw-1 try-job: x86_64-msvc-1
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-7/+127
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-08-07Optimize `char::is_alphanumeric`Karl Meakin-1/+5
Avoid an unnecessary call to `unicode::Alphabetic` when `self` is an ASCII digit (ie `0..=9`).
2025-08-06Rollup merge of #144975 - joshtriplett:file-times-dir, r=jhprattGuillaume Gomez-1/+6
`File::set_times`: Update documentation and example to support setting timestamps on directories Inspired by https://github.com/rust-lang/rust/issues/123883 .
2025-08-06Rollup merge of #144972 - the8472:file-prefix-docs, r=joshtriplettGuillaume Gomez-0/+2
add code example showing that file_prefix treats dotfiles as the name of a file, not an extension This came up in a libs-api meeting while we were reviewing rust-lang/rust#144870
2025-08-06Rollup merge of #144861 - Kivooeo:payload-as-str-stabilization, r=ChrisDentonGuillaume Gomez-3/+1
Stabilize `panic_payload_as_str` feature Closes [tracking issue](https://github.com/rust-lang/rust/issues/125175). Part of https://github.com/rust-lang/rust/issues/116005. FCP ended more than year ago in tracking issue, I'm not sure if we should rerun it.
2025-08-06Reword documentation for `set_times` to clarify directory handlingJosh Triplett-2/+3
2025-08-06tidyBoxy-123/+123
2025-08-06Change stdlib float tests to account for miri nondet floats.LorrensP-2158466-35/+35
2025-08-06Clarify EOF handling for `BufRead::skip_until`ginnyTheCat-2/+7
2025-08-06Rollup merge of #144978 - ehuss:intrinsic-doc-links, r=scottmcmJakub Beránek-4/+4
Fix some doc links for intrinsics This fixes a few intrinsic docs that had a link directly to itself instead of to the correct function in the `mem` module.