about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-05Merge pull request #4310 from RalfJung/addr-space-conservationRalf Jung-8/+17
alloc_addresses: when we are running out of addresses, start reusing more aggressively
2025-05-05Merge pull request #4309 from RalfJung/both-borrows-testsRalf Jung-532/+94
move tests that are identical between SB and TB to shared files
2025-05-05alloc_addresses: when we are running out of addresses, start reusing more ↵Ralf Jung-8/+17
aggressively
2025-05-05consistent folder naming: stacked-borrows -> stacked_borrowsRalf Jung-6/+6
2025-05-05Merge pull request #4306 from yoctocell/fix-unsafecell-inside-boxRalf Jung-1/+43
Tree Borrows: Correctly handle interior mutable data in `Box`
2025-05-05move tests that are identical between SB and TB to shared filesRalf Jung-764/+326
2025-05-05Merge pull request #4307 from JoJoDeveloping/remove-unique-is-uniqueRalf Jung-451/+12
Remove -Zunique-is-unique
2025-05-04Remove -Zunique-is-uniqueJohannes Hostert-451/+12
2025-05-03Merge pull request #4308 from rust-lang/rustup-2025-05-03Oli Scherer-1759/+5329
Automatic Rustup
2025-05-03Merge from rustcThe Miri Cronjob Bot-1758/+5328
2025-05-03Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-03Auto merge of #140442 - osiewicz:collector-walk-less-fine-grained-locking, ↵bors-27/+38
r=wesleywiser mono collector: Reduce # of locking while walking the graph While profiling Zed's dev build I've noticed that while most of the time `upstream_monomorphizations` takes a lot of time in monomorpization_collector, in some cases (e.g. build of `editor` itself) the rest of monomorphization_collector_graph_walk dominates it. Most of the time is spent in collect_items_rec. This PR aims to reduce the number of locks taking place; instead of locking output MonoItems once per children of current node, we do so once per *current node*. We also get to reuse locks for mentioned and used items. While this commit does not reduce Wall time of Zed's build, it does shave off CPU time (measured with `cargo build -j1`) from 48s to 47s. I've also tested it with parallel frontend against Zed and ripgrep and found no regressions.
2025-05-02Auto merge of #140596 - matthiaskrgr:rollup-s7tzr34, r=matthiaskrgrbors-309/+403
Rollup of 9 pull requests Successful merges: - #140485 (Optimize the codegen for `Span::from_expansion`) - #140509 (transmutability: merge contiguous runs with a common destination) - #140519 (Use select in projection lookup in `report_projection_error`) - #140521 (interpret: better error message for out-of-bounds pointer arithmetic and accesses) - #140536 (Rename `*Guard::try_map` to `filter_map`.) - #140550 (Stabilize `select_unpredictable`) - #140563 (extend the list of registered dylibs on `test::prepare_cargo_test`) - #140572 (Add useful comments on `ExprKind::If` variants.) - #140574 (Add regression test for 133065) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-02Construct test so that it would fail for old codeXinglu Chen-5/+22
2025-05-02Rollup merge of #140574 - reddevilmidzy:add-test, r=compiler-errorsMatthias Krüger-0/+31
Add regression test for 133065 closes: #133065
2025-05-02Rollup merge of #140572 - nnethercote:comment-ExprKind-If, r=compiler-errorsMatthias Krüger-0/+9
Add useful comments on `ExprKind::If` variants. Things that aren't obvious and took me a while to work out. r? `@BoxyUwU`
2025-05-02Rollup merge of #140563 - onur-ozkan:extend-dylib-paths, r=jieyouxuMatthias Krüger-3/+3
extend the list of registered dylibs on `test::prepare_cargo_test` self-explanatory Fixes #140299
2025-05-02Rollup merge of #140550 - Amanieu:stabilize_select_unpredictable, ↵Matthias Krüger-5/+1
r=workingjubilee Stabilize `select_unpredictable` FCP completed in tracking issue #133962.
2025-05-02Rollup merge of #140536 - zachs18:mapped-guard-filter-map, r=AmanieuMatthias Krüger-59/+61
Rename `*Guard::try_map` to `filter_map`. Rename `std::sync::*Guard::try_map` to `filter_map`. 1. Analogous to `std::cell::Ref(Mut)::filter_map`. 2. Doesn't imply `Try` genericizability. r? `@Amanieu` (or other T-libs-api) Tracking issue for `mapped_lock_guards`: https://github.com/rust-lang/rust/issues/117108
2025-05-02Rollup merge of #140521 - RalfJung:oob-error, r=saethlinMatthias Krüger-213/+202
interpret: better error message for out-of-bounds pointer arithmetic and accesses Fixes https://github.com/rust-lang/rust/issues/93881 r? `@saethlin`
2025-05-02Rollup merge of #140519 - compiler-errors:name-based-comparison, r=oli-obkMatthias Krüger-20/+62
Use select in projection lookup in `report_projection_error` Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to https://github.com/rust-lang/rust/pull/140278. r? oli-obk
2025-05-02Rollup merge of #140509 - tmiasko:merge-contiguous-ranges, r=jswrennMatthias Krüger-7/+19
transmutability: merge contiguous runs with a common destination Based on #140380. r? `@jswrenn` `@joshlf`
2025-05-02Rollup merge of #140485 - Jarcho:from_expansion_opt, r=petrochenkovMatthias Krüger-2/+15
Optimize the codegen for `Span::from_expansion` See https://godbolt.org/z/bq65Y6bc4 for the difference. the new version is less than half the number of instructions. Also tried fully writing the function by hand: ```rust sp.ctxt_or_parent_or_marker != 0 && ( sp.len_with_tag_or_marker == BASE_LEN_INTERNED_MARKER || sp.len_with_tag_or_marker & PARENT_TAG == 0 ) ``` But that was no better than this PR's current use of `match_span_kind`.
2025-05-02Auto merge of #140406 - Urgau:autorefs-perf, r=nnethercotebors-4/+11
perf: delay checking of `#[rustc_no_implicit_autorefs]` in autoref lint Try to address the regression seen in https://github.com/rust-lang/rust/pull/123239#issuecomment-2835418470 by delaying the checking of `#[rustc_no_implicit_autorefs]` on method call.
2025-05-02Correctly handle interior mutable data in `Box`Xinglu Chen-1/+26
Previously, the pointee type would be behind a `*const` pointer, so `ty_is_freeze` would always be `true`, even if there was an `UnsafeCell` in `Box`.
2025-05-02Auto merge of #140581 - Zalathar:rollup-ig2jb9v, r=Zalatharbors-223/+1723
Rollup of 12 pull requests Successful merges: - #134034 (handle paren in macro expand for let-init-else expr) - #137474 (pretty-print: Print shebang at the top of the output) - #138872 (rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs) - #139046 (Improve `Lifetime::suggestion`) - #139206 (std: use the address of `errno` to identify threads in `unique_thread_exit`) - #139608 (Clarify `async` block behaviour) - #139847 (Delegate to inner `vec::IntoIter` from `env::ArgsOs`) - #140159 (Avoid redundant WTF-8 checks in `PathBuf`) - #140197 (Document breaking out of a named code block) - #140389 (Remove `avx512dq` and `avx512vl` implication for `avx512fp16`) - #140430 (Improve test coverage of HIR pretty printing.) - #140507 (rustc_target: RISC-V: feature addition batch 3) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-02Merge pull request #4291 from Patrick-6/miri-genmc-prepRalf Jung-307/+1254
GenMC implementation initial changes
2025-05-02Implement skeleton code for adding GenMC support to Miri (not yet functional).Patrick-6-307/+1254
- Add a cargo feature to enable GenMC support (off by default) - Add support for GenMC datastructures to MiriMachine - Adjust several functions where GenMC needs to be informed about relevant events (e.g., atomic accesses) - Add skeleton code for parsing GenMC command line arguments - Some cleanup - Finish sentences with a `.` - Fix some spelling errors/typos Co-authored-by: Ralf Jung <post@ralfj.de>
2025-05-02Rollup merge of #140507 - a4lg:riscv-feature-addition-batch-3, r=AmanieuStuart Cook-1/+21
rustc_target: RISC-V: feature addition batch 3 This is the last batch (3 of 3) for RISC-V feature enhancements intended for the version 1.88 cycle. The author's primary criteria are: 1. The extension is ratified and unprivileged one. 2. The extension is in the RVA23U64 profile (to be a baseline of the application-class RISC-V software ecosystem in the near future), either mandatory or optional. 3. Either: 1. To be discoverable through a `riscv_hwprobe` system call on (currently unreleased) Linux 6.15 (as of rc4) or 2. Helps memory/atomics-related operations more efficient and/or more robust. This is based on the specifications: * [The latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications) * [RVA23/RVB23 profiles](https://github.com/riscv/riscv-profiles/releases/tag/rva23-rvb23-ratified) * [RISC-V BF16 extensions](https://github.com/riscv/riscv-bfloat16/releases/tag/v183a3dac863d7c18187a739eb52b0c8f0d16854d) LLVM Definitions: * [`Zicbop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L82-87) * [`Zicbom`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L75-L80) * [`Zic64b`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L71-L73) * [`Ziccamoa`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L97-L99) * [`Ziccif`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L101-L103) * [`Zicclsm`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L105-L107) * [`Ziccrse`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L109-L111) * [`Zfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L320-L325) * [`Zvfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L697-L702) * [`Zvfbfwma`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L704-L710) The `Zicbop` extension (mandatory in RVA23U64) adds prefetch hints to prepare for subsequent memory operations (will be executed as no-op if the hardware does not support this extension). The `Zicbom` extension (mandatory in RVA23U64) adds cache block-management instructions. The author did not include this in the batch 2 (because of limited use cases compared to the `Zicboz` extension) but added because it will be discoverable from Linux (as of version 6.15-rc4). Along with `Zicbop`, Rust now supports all CMO extensions. The `Zic64b` extension (mandatory in RVA23U64) constraints the cache block to be naturally-aligned and exactly 64 bytes. Along with CMO instructions, it can improve efficiency handling with memory (e.g. efficient memory zeroing using `Zicboz` + `Zic64b`). The `Zicc*` extensions (mandatory in RVA23U64) add constraints to the main memory properties. They are normally satisfied in the application environment with regular OSes but profiles like RVA23U64 ensures such properties are satisfied (through those *constraint* extensions). The `Zfbf*` and `Zvfbf*` extensions (optional in RVA23U64) add instructions to handle BF16 (BFloat16) data. Although stabilization of FP-related extensions are relatively far due to ABI-related issues, they are included in this batch because they will be discoverable from Linux (as of version 6.15-rc4). The author also adds the extension implication: `Za64rs` → `Za128rs` (superset) which the author missed to include in #140139.
2025-05-02Rollup merge of #140430 - nnethercote:hir-exhaustive, r=dtolnayStuart Cook-104/+1014
Improve test coverage of HIR pretty printing. Details in individual commits. r? `@dtolnay` try-job: test-various
2025-05-02Rollup merge of #140389 - sayantn:avx512fp16, r=AmanieuStuart Cook-5/+2
Remove `avx512dq` and `avx512vl` implication for `avx512fp16` According to Intel, `avx512fp16` requires only `avx512bw`, but LLVM also enables `avx512vl` and `avx512dq` when `avx512fp16` is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512 Related: - llvm/llvm-project#136209 - #138940 - rust-lang/stdarch#1781 - #111137 ``@rustbot`` label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs r? ``@Amanieu`` **Update: the LLVM fix has been merged** cc ``@rust-lang/wg-llvm`` will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450
2025-05-02Rollup merge of #140197 - ktnlvr:master, r=workingjubileeStuart Cook-1/+28
Document breaking out of a named code block Closes #110758.
2025-05-02Rollup merge of #140159 - thaliaarchi:pathbuf-extension, r=workingjubileeStuart Cook-31/+65
Avoid redundant WTF-8 checks in `PathBuf` Eliminate checks for WTF-8 boundaries in `PathBuf::set_extension` and `add_extension`, where joining WTF-8 surrogate halves is impossible. Don't convert the `str` to `OsStr`, because `OsString::push` specializes to skip the joining when given strings. To assist in this, mark the internal methods `OsString::truncate` and `extend_from_slice` as `unsafe` to communicate their safety invariants better than with module privacy. Similar to #137777. cc `@joboet` `@ChrisDenton`
2025-05-02Rollup merge of #139847 - thaliaarchi:args/delegate-iter, r=workingjubileeStuart Cook-21/+207
Delegate to inner `vec::IntoIter` from `env::ArgsOs` Delegate from `std::env::ArgsOs` to the methods of the inner platform-specific iterators, when it would be more efficient than just using the default methods of its own impl. Most platforms use `vec::IntoIter` as the inner type, so prioritize delegating to the methods it provides. `std::env::Args` is implemented atop `std::env::ArgsOs` and performs UTF-8 validation with a panic for invalid data. This is a visible effect which users certainly rely on, so we can't skip any arguments. Any further iterator methods would skip some elements, so no change is needed for that type. Add `#[inline]` for any methods which simply wrap the inner iterator.
2025-05-02Rollup merge of #139608 - Lynnesbian:improve-async-block-docs, r=ibraheemdevStuart Cook-0/+60
Clarify `async` block behaviour Adds some documentation for control flow behaviour pertaining to `return` and `?` within `async` blocks. Fixes (or at least improves) #101444. r? rust-lang/docs
2025-05-02Rollup merge of #139206 - joboet:unique_thread_errno, r=ibraheemdevStuart Cook-24/+21
std: use the address of `errno` to identify threads in `unique_thread_exit` Getting the address of `errno` should be just as cheap as `pthread_self()` and avoids having to use the expensive `Mutex` logic because it always results in a pointer.
2025-05-02Rollup merge of #139046 - nnethercote:hir-Lifetime-better, r=lcnrStuart Cook-31/+104
Improve `Lifetime::suggestion` r? ``@lcnr``
2025-05-02Rollup merge of #138872 - a4lg:riscv-fix-incompatible-abi-zfinx, ↵Stuart Cook-5/+25
r=workingjubilee rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs Because RISC-V Calling Conventions note that: > This means code targeting the `Zfinx` extension always uses the ILP32, ILP32E or LP64 integer calling-convention only ABIs as there is no dedicated hardware floating-point register file. `{ILP32,LP64}[FD]` ABIs with hardware floating-point calling conventions are incompatible with the `Zfinx` extension. This commit adds `"zfinx"` to the incompatible feature list to those ABIs and tests whether trying to add `"zdinx"` (that is analogous to `"zfinx"` but in double-precision) on a LP64D ABI configuration results in an error (it also tests extension implication; `Zdinx` requires `Zfinx` extension). Links: RISC-V psABI specification version 1.0 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/v1.0/riscv-cc.adoc#named-abis> <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-02Rollup merge of #137474 - VlaDexa:shebang-placement, r=wesleywiserStuart Cook-0/+37
pretty-print: Print shebang at the top of the output Shebang should stay at the top of the file, even after pretty-printing. Closes #134643
2025-05-02Rollup merge of #134034 - bvanjoi:issue-131655, r=petrochenkovStuart Cook-0/+139
handle paren in macro expand for let-init-else expr Fixes #131655 This PR modifies the codegen logic of the macro expansion within `let-init-else` expression: - Before: The expression `let xxx = (mac! {}) else {}` expands to `let xxx = (expanded_ast) else {}`. - After: The same expression expands to `let xxx = expanded_ast else {}`. An alternative solution to this issue could involve handling the source code directly when encountering unused parentheses in `let-init-else` expressions. However, this approach might be more cumbersome due to the absence of the necessary data structure. r? `@petrochenkov`
2025-05-02Auto merge of #139883 - matthiaskrgr:crashesapr15, r=Mark-Simulacrumbors-0/+332
crashes: more tests try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-05-02Auto merge of #140540 - flip1995:clippy-subtree-update, r=Manishearthbors-582/+1819
Clippy subtree update r? `@Manishearth`
2025-05-02Merge pull request #4305 from RalfJung/squashRalf Jung-10/+84
add ./miri squash
2025-05-02Add regression test for 133065reddevilmidzy-0/+31
2025-05-02add ./miri squashRalf Jung-10/+84
2025-05-02Add useful comments on `ExprKind::If` variants.Nicholas Nethercote-0/+9
Things that aren't obvious and took me a while to work out.
2025-05-02Auto merge of #140565 - GuillaumeGomez:rollup-gv4ed14, r=GuillaumeGomezbors-422/+755
Rollup of 12 pull requests Successful merges: - #138703 (chore: remove redundant words in comment) - #139186 (Refactor `diy_float`) - #139780 (docs: Add example to `Iterator::take` with `by_ref`) - #139802 (Fix some grammar errors and hyperlinks in doc for `trait Allocator`) - #140034 (simd_select_bitmask: the 'padding' bits in the mask are just ignored) - #140062 (std: mention `remove_dir_all` can emit `DirectoryNotEmpty` when concurrently written into) - #140420 (rustdoc: Fix doctest heuristic for main fn wrapping) - #140460 (Fix handling of LoongArch target features not supported by LLVM 19) - #140538 (rustc-dev-guide subtree update) - #140544 (Clean up "const" situation in format_args!(). ) - #140552 (allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`) - #140556 (Improve error output in case `nodejs` or `npm` is not installed for rustdoc-gui test suite) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-02Amend language regarding the never typeLynnesbian-2/+2
2025-05-02Improve coverage of HIR pretty printing.Nicholas Nethercote-104/+1014
By taking the existing `expanded-exhaustive.rs` test and running it with both `Zunpretty=expanded` *and* `Zunpretty=hir`. Also rename some files, and split the asm parts out so they only run on x86-64.
2025-05-02Handle `Path<>` better in error messages.Nicholas Nethercote-37/+50
`Path<>` needs to be distinguished from `Path<T>`. This commit does that, improving some error messages.