about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-03Rollup merge of #140597 - SchmErik:rm-schmerik, r=UrgauMatthias Krüger-1/+0
zkvm: remove schmerik as target maintainer I am no longer actively working on this target so I would like to be dropped from this list.
2025-05-03Rollup merge of #140595 - lolbinarycat:std-set_permissions-typo, r=cuviperMatthias Krüger-1/+1
doc(std): fix typo lchown -> lchmod chown is irrelevant here, as this function does not affect file ownership. chmod is the correct function to reference here.
2025-05-03Rollup merge of #140582 - GuillaumeGomez:update-sysinfo, r=KobzolMatthias Krüger-84/+166
Update sysinfo to `0.35.0` in bootstrap and `tools/opt-dist` This release is mostly bugfixes and code improvements.
2025-05-03Rollup merge of #140576 - m-ou-se:fragile-tests, r=compiler-errorsMatthias Krüger-201/+0
Remove fragile equal-pointers-unequal tests. Same as https://github.com/rust-lang/rust/pull/139176 --- These tests were added in #127003 These tests stop working when I change implementation details of format_args!(). These tests shouldn't rely on such implementation details. Do these tests test anything that isn't already covered by other tests? If so, they should be expressed in a less fragile way that doesn't rely on internal details of format_args!(). cc `@GrigorenkoPV,` author of these tests.
2025-05-03Rollup merge of #140395 - RalfJung:target-feature-tests, r=petrochenkovMatthias Krüger-58/+128
organize and extend forbidden target feature tests In particular this adds some loongarch tests for https://github.com/rust-lang/rust/pull/135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help. try-job: `x86_64-gnu-llvm-20-*`
2025-05-03Rollup merge of #138712 - petrochenkov:impasst, r=fmeaseMatthias Krüger-113/+168
resolve: Support imports of associated types and glob imports from traits Follow up to https://github.com/rust-lang/rust/pull/134754, part of https://github.com/rust-lang/rust/issues/134691. This PR also closes https://github.com/rust-lang/rust/issues/138711 now. Prohibiting `use Trait::AssocType;` at name resolution stage doesn't make sense, the name itself is perfectly resolveable. It's a type checker's problem that the necessary generic args are not passed when the imported `AssocType` is used, so an error should be reported there. And since we can import associated trait items now, glob imports from traits can also be allowed.
2025-05-03Auto merge of #140608 - matthiaskrgr:rollup-twv6muy, r=matthiaskrgrbors-167/+316
Rollup of 8 pull requests Successful merges: - #139343 (Change signature of File::try_lock and File::try_lock_shared) - #140505 (linker: Quote symbol names in .def files) - #140534 (PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef…) - #140546 (Remove backtrace dep from anyhow in features status dump tool) - #140548 (Emit user type annotations for free consts in pattern position) - #140564 (Use present indicative tense in std::io::pipe() API docs) - #140568 (Add regression test for #140545) - #140606 (Improve hir pretty printing) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-03Rollup merge of #140606 - nnethercote:hir-pp, r=dtolnayMatthias Krüger-95/+95
Improve hir pretty printing It's currently pretty bad, so a few small improvements can make a big difference. r? `@dtolnay`
2025-05-03Rollup merge of #140568 - moxian:reg-140545, r=compiler-errorsMatthias Krüger-0/+29
Add regression test for #140545 Closes #140545 I am not very knowledgable about the typesystem internals, so I couldn't come up with a good name for the test. But I'm happy to move it to a more appropriate place if there is one (`tests/ui/impl-trait/non-defining-uses` maybe?) r? types (or reroll as appropriate if this is not actually a T-types issue; i'm clueless)
2025-05-03Rollup merge of #140564 - ↵Matthias Krüger-3/+3
ebkalderon:use-present-indicative-in-std-io-pipe-docs, r=tgross35 Use present indicative tense in std::io::pipe() API docs The inline documentation for all other free functions in the `std::io` module use the phrase "creates a" instead of "create a", except for the currently nightly-only `std::io::pipe()` function. This commit updates the text to align with the predominant wording in the `std::io` module. I recognize this PR is quite a minuscule nitpick, so feel free to ignore and close if you disagree and/or there are bigger fish to fry. Thanks in advance! :smile: Relates to https://github.com/rust-lang/rust/issues/127154.
2025-05-03Rollup merge of #140548 - BoxyUwU:gci_patterns_user_ty_annotation, ↵Matthias Krüger-2/+26
r=compiler-errors Emit user type annotations for free consts in pattern position This previously wasnt done because free consts couldn't have any generic parameters that need to be preserved for borrowck. This is no longer the case with `feature(generic_const_items)` r? fmease
2025-05-03Rollup merge of #140546 - LegNeato:anyhowbacktrace, r=jieyouxuMatthias Krüger-4/+1
Remove backtrace dep from anyhow in features status dump tool According to `anyhow`'s Cargo.toml: > On compilers older than 1.65, features=["backtrace"] may be used to enable > backtraces via the `backtrace` crate. This feature has no effect on 1.65+ > besides bringing in an unused dependency, as `std::backtrace` is always > preferred. So this is just bringing in an unused dependency.
2025-05-03Rollup merge of #140534 - erickt:llvm-21, r=cuviperMatthias Krüger-0/+5
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef… …7e8877fc1908 In LLVM 21 PR https://github.com/llvm/llvm-project/pull/130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method. ``@rustbot`` label llvm-main
2025-05-03Rollup merge of #140505 - petrochenkov:expquote, r=bjorn3Matthias Krüger-1/+13
linker: Quote symbol names in .def files To support weird symbol names, including dots in particular. cc [#134767](https://github.com/rust-lang/rust/pull/134767#issuecomment-2839397610)
2025-05-03Rollup merge of #139343 - cberner:filelock_wouldblock, r=workingjubileeMatthias Krüger-62/+144
Change signature of File::try_lock and File::try_lock_shared These methods now return Result<(), TryLockError> instead of Result<bool, Error> to make their use less errorprone These methods are unstable under the "file_lock" feature. The related tracking issue is https://github.com/rust-lang/rust/pull/130999 and this PR changes the signatures as discussed by libs-api: https://github.com/rust-lang/rust/issues/130994#issuecomment-2770838848
2025-05-03Avoid an indent for labelled loops.Nicholas Nethercote-6/+5
2025-05-03Fix some hir pretty-printing over-indenting.Nicholas Nethercote-35/+36
2025-05-03Improve hir pretty-printing of attributes.Nicholas Nethercote-21/+49
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-03Enable `BoxMarker` drop checking.Nicholas Nethercote-5/+1
All the box open/close issues have been fixed.
2025-05-03Fix hir pretty-printing of `global_asm!`.Nicholas Nethercote-4/+6
One of the boxes isn't closed, and this causes everything after it to be over-indented.
2025-05-03Remove opaque type printing.Nicholas Nethercote-9/+1
As far as I can tell, this code is not actually reachable.
2025-05-03Remove fake `BoxMarker`s.Nicholas Nethercote-19/+1
They don't appear to do anything -- no test output is affected -- and no other pretty-printing code looks like this.
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-02Add a regression testmoxian-0/+29
for #140545
2025-05-02zkvm: remove schmerik from maintainers listErik Kaneda-1/+0
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-02doc(std): fix typo lchown -> lchmodbinarycat-1/+1
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-02linker: Quote symbol names in .def filesVadim Petrochenkov-1/+13
To support weird symbol names, including dots in particular.
2025-05-02resolve: Support imports of associated types and glob imports from traitsVadim Petrochenkov-113/+168
2025-05-02Update sysinfo to `0.35.0` in `src/tools/opt-dist`Guillaume Gomez-68/+35
2025-05-02Update sysinfo version to `0.35.0`Guillaume Gomez-16/+131
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.