Commit Graph

323544 Commits

Author SHA1 Message Date
mejrs 4645f036d0 triagebot: notify on diagnostic attribute changes 2026-04-16 15:48:06 +02:00
bors dab8d9d106 Auto merge of #155199 - JonathanBrouwer:rollup-OhWpGAc, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#155197 (miri subtree update)
 - rust-lang/rust#154804 (Fix ICE when reporting host-effect errors for const Fn HRTBs in next trait solver)
 - rust-lang/rust#155014 (Hexagon: add scalar arch-version target features (v60-v79, audio))
 - rust-lang/rust#155068 (Fix ICE in `span_extend_prev_while` with multibyte characters)
 - rust-lang/rust#155161 (Use Vec::push_mut when adding a chunk to arenas)
2026-04-12 13:57:41 +00:00
Jonathan Brouwer bf4d3851c6 Rollup merge of #155161 - saethlin:push_mut_saves, r=Kivooeo
Use Vec::push_mut when adding a chunk to arenas

This fixes https://github.com/rust-lang/rust/issues/155148, which may or may not be worth fixing on its own merits, but I think `Vec::push_mut` also makes the code nicer.
2026-04-12 15:44:20 +02:00
Jonathan Brouwer 2834b1654a Rollup merge of #155068 - lapla-cogito:multibyte_char, r=mati865
Fix ICE in `span_extend_prev_while` with multibyte characters

Fixes https://github.com/rust-lang/rust/issues/155037

The function assumed that the character found by `rfind` was always one byte wide, using a hardcoded `1` instead of `c.len_utf8()`. When a multibyte character appeared immediately before the span, this caused the resulting span to point into the middle of a UTF-8 sequence, triggering an assertion failure in `bytepos_to_file_charpos`.
2026-04-12 15:44:20 +02:00
Jonathan Brouwer 5daeaa9b3a Rollup merge of #155014 - androm3da:hexagon-scalar-target-features, r=mati865
Hexagon: add scalar arch-version target features (v60-v79, audio)

Add target features corresponding to Hexagon LLVM CPU generations to complement the existing HVX vector features. These are needed for gating scalar intrinsics by architecture version.

New features: audio, v60, v62, v65, v66, v67, v68, v69, v71, v73, v75, v79

Each version implies the previous (e.g. v68 implies v67 which implies v66, etc.), matching LLVM's ArchV60-ArchV79 subtarget features.

Also adds hexagon revisions to the feature-hierarchy test to verify the implied feature chains work correctly.
2026-04-12 15:44:19 +02:00
Jonathan Brouwer b36833d634 Rollup merge of #154804 - cijiugechu:fix/host-effect-hrtb-ice, r=adwinwhite
Fix ICE when reporting host-effect errors for const Fn HRTBs in next trait solver

Avoid leaking bound vars into the diagnostic selection path for HRTB host-effect predicates.

Closes rust-lang/rust#151894 .
2026-04-12 15:44:18 +02:00
Jonathan Brouwer fa6fedceba Rollup merge of #155197 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/871d3d06c549cb554dec9a3a7c37cdd723254d06.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-04-12 15:44:18 +02:00
bors 532f8f1443 Auto merge of #155154 - clarfonthey:hashbrown-0.17, r=Mark-Simulacrum
Update hashbrown to 0.17

The main benefit of this update is to include one potential UB fix and one bug; relevant changelog entries:

* Fixed potential UB in `RawTableInner::fallible_with_capacity` (rust-lang/hashbrown#692)
* Fixed incorrect length if a hasher panics during rehash (rust-lang/hashbrown#710)

cc @Amanieu

Also cc @RalfJung who had also noticed the UB issue with `-Zmiri-recursive-validation`.
2026-04-12 10:44:20 +00:00
Ralf Jung edf04e18af Merge pull request #4950 from WhySoBad/fix-blocking-io-manager
Fix panic when multiple threads block on same fd
2026-04-12 09:04:53 +00:00
bors 540f43a224 Auto merge of #155185 - matthiaskrgr:rollup-JYNqFhW, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#155171 (Patch musl's CVE-2026-6042 and CVE-2026-40200)
 - rust-lang/rust#153630 (Deprioritize doc(hidden) re-exports in diagnostic paths)
 - rust-lang/rust#152613 (unsafe keyword docs: bring back unsafe_op_in_unsafe_fn lint discussion)
 - rust-lang/rust#155142 (impl const Residual for ControlFlow)
2026-04-12 07:34:56 +00:00
cijiugechu 0b02f678c4 Handle leaked host-effect HRTBs before selection 2026-04-12 14:44:20 +08:00
Matthias Krüger 11469dc9f5 Rollup merge of #155142 - nxsaken:const_residual_control_flow, r=fee1-dead
impl const Residual for ControlFlow

Feature: rust-lang/rust#91285 (`try_trait_v2_residual`/`const_try_residual`)

r? @fee1-dead
2026-04-12 08:15:48 +02:00
Matthias Krüger ba98b3558a Rollup merge of #152613 - RalfJung:unsafe-keyword-docs, r=traviscross
unsafe keyword docs: bring back unsafe_op_in_unsafe_fn lint discussion

@traviscross in rust-lang/rust#141471 you asked me to also update the text to account for the edition change. Apparently I did that by entirely removing this part of the discussion (except for a dangling forward reference, a "see below"). Given that old editions still exist and given that `unsafe_op_in_unsafe_fn` is just a lint so the old behavior also still exists on new editions, I am no longer sure that was a good idea, so this brings back the old text with some editing to explain the current situation.
2026-04-12 08:15:47 +02:00
Matthias Krüger 56ecb157e2 Rollup merge of #153630 - arferreira:fix-doc-hidden-reexport-diagnostic-path, r=jackh726
Deprioritize doc(hidden) re-exports in diagnostic paths

Fixes rust-lang/rust#153477.

This is the other half of rust-lang/rust#99698, which fixed the case where the *parent module* is `#[doc(hidden)]` but left the case where the re-export itself is `#[doc(hidden)]` as a FIXME (with a tracking test in `dont-suggest-doc-hidden-variant-for-enum/hidden-child.rs`).

The problem: when a crate does `#[doc(hidden)] pub use core::error::Error`, diagnostics pick up the hidden re-export path instead of the canonical one. For example, `snafu::Error` instead of `std::error::Error`.

Two changes:

In `visible_parent_map`, the `add_child` closure now checks whether the re-export itself is `#[doc(hidden)]` via `reexport_chain` and sends it to `fallback_map`, same treatment as doc-hidden parents and underscore re-exports.

`should_encode_attrs` now returns `true` for `DefKind::Use`. Without this, `#[doc(hidden)]` on `use` items was never written to crate metadata, so `is_doc_hidden` always returned `false` cross-crate. This was the actual root cause, the check in `visible_parent_map` alone isn't enough if the attribute isn't in the metadata.

The existing FIXME test now serves as the regression test. The `.stderr` goes from suggesting `hidden_child::__private::Some(1i32)` to just `Some(1i32)`.

cc @eggyal
2026-04-12 08:15:46 +02:00
Matthias Krüger 8bd29964c0 Rollup merge of #155171 - cuviper:musl-cves, r=Mark-Simulacrum
Patch musl's CVE-2026-6042 and CVE-2026-40200

- [CVE-2026-6042] is a denial of service in `iconv`.
- [CVE-2026-40200] is an out-of-bounds write in `qsort`.

Neither is relevant to Rust itself, but they could be used in mixed-language projects that link with our `self-contained/libc.a`.

[CVE-2026-6042]: https://www.openwall.com/lists/oss-security/2026/04/09/19
[CVE-2026-40200]: https://www.openwall.com/lists/musl/2026/04/10/3
2026-04-12 08:15:46 +02:00
bors d32e620a10 Auto merge of #155166 - JonathanBrouwer:rollup-YH2oUIz, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#155057 (Update libc to v0.2.184)
 - rust-lang/rust#154967 (Test(lib/sync): Fix `test_rwlock_max_readers` for x86 Win7)
 - rust-lang/rust#154994 (don't leak internal temporaries from `dbg!`)
 - rust-lang/rust#155130 (Stabilize feature `isolate_most_least_significant_one`)
 - rust-lang/rust#154925 (Make Box/Rc/Arc::into_array allocator-aware (and add doctest))
 - rust-lang/rust#155063 (`ty::Alias`: replace `def_id: did` with `def_id`)
2026-04-12 04:25:51 +00:00
Travis Cross ae3b150378 Fix a typo 2026-04-12 04:03:30 +00:00
bors 6ad4d1b0e7 Auto merge of #155175 - jhpratt:rollup-jQuvnVx, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#155084 (Initial functions to start on transmute v2)
 - rust-lang/rust#155126 (add `cfg(target_object_format = "...")`)
 - rust-lang/rust#155165 (Portable SIMD subtree update)
 - rust-lang/rust#153871 (fix spurious test failure in `metadata_access_times`)
 - rust-lang/rust#155150 (replace <name> @ ty::AliasTy matches with just using args: <name>_args)
 - rust-lang/rust#155159 (Fix min-specialization ICE from ignored region resolution failure)
 - rust-lang/rust#155167 (Reduce size of `ImportData`)
2026-04-12 01:16:28 +00:00
Jacob Pratt 040b6db55d Rollup merge of #155167 - mejrs:box_directive, r=Kivooeo
Reduce size of `ImportData`

Perhaps this will undo the regression caused by https://github.com/rust-lang/rust/pull/152901
2026-04-11 21:12:23 -04:00
Jacob Pratt 22328dc33a Rollup merge of #155159 - TaKO8Ki:min-specialization-next-solver-region-resolution, r=Kivooeo
Fix min-specialization ICE from ignored region resolution failure

Fixes rust-lang/rust#151327

`min_specialization::get_impl_args` resolved regions and then immediately called `fully_resolve`, but it ignored failures from `resolve_regions_and_report_errors`.

Propagate the region-resolution error instead of ignoring it. That matches the pattern used in:

https://github.com/rust-lang/rust/blob/40a3ed1e1407ebbe892ce1a74128482ea1dadf7a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs#L706

https://github.com/rust-lang/rust/blob/40a3ed1e1407ebbe892ce1a74128482ea1dadf7a/compiler/rustc_hir_analysis/src/coherence/builtin.rs#L421
2026-04-11 21:12:23 -04:00
Jacob Pratt 6d7015ccab Rollup merge of #155150 - WilliamTakeshi:alias-ty-args-binding, r=WaffleLapkin,Kivooeo
replace <name> @ ty::AliasTy matches with just using args: <name>_args

ref rust-lang/rust#154941

replace `<name> @ ty::AliasTy` matches with just using `args: <name>_args`

I updated all occurrences where <name> @ ty::AliasTy became unnecessary after the change. In cases where both forms are still used, no changes were made.

r? @WaffleLapkin
2026-04-11 21:12:22 -04:00
Jacob Pratt af4f14bd3d Rollup merge of #153871 - mattiapitossi:issue-148408, r=Mark-Simulacrum
fix spurious test failure in `metadata_access_times`

Fixes rust-lang/rust#148408

The metadata_access_times test checks if the creation of a file occurs before another file, this check happens only on Linux. While on Win and Macos we check only that the created metadata is available. Given that the SystemTime is non monotonic as Instant this test could result in failures when the system clock changes.
2026-04-11 21:12:22 -04:00
Jacob Pratt d82e5e6bde Rollup merge of #155165 - folkertdev:sync-from-portable-simd-2026-04-11, r=folkertdev
Portable SIMD subtree update

Let's see if this works (we might need a sync the other way first)
2026-04-11 21:12:21 -04:00
Jacob Pratt 1700a21d10 Rollup merge of #155126 - folkertdev:target-object-format, r=Urgau
add `cfg(target_object_format = "...")`

tracking issue: https://github.com/rust-lang/rust/issues/152586

I'm implementing the predicate as `target_object_format`, because that's what is useful to me (for testing `#[link_section = "..."]` where `mach-o` has some extra restrictions) and maps cleanly to the `BinaryFormat` enum that is used internally. There is still room for a future `target_executable_format` when there is a use case.

cc @joshtriplett as the lang sponsor of this feature, @workingjubilee as the author of the proposal.

r? JonathanBrouwer a sidequest from the sidequest that is https://github.com/rust-lang/rust/pull/155065
2026-04-11 21:12:20 -04:00
Jacob Pratt d83352b491 Rollup merge of #155084 - scottmcm:add-transmute-prefix, r=Mark-Simulacrum
Initial functions to start on transmute v2

For context, see https://github.com/rust-lang/rfcs/pull/3844 and https://github.com/rust-lang/libs-team/issues/772

*Experimental* still, tracked under https://github.com/rust-lang/rust/issues/155079

This is just library functions.  A future PR will do compiler changes for things like lints.
2026-04-11 21:12:19 -04:00
Josh Stone 88305519bb Patch musl's CVE-2026-6042 and CVE-2026-40200
- [CVE-2026-6042] is a denial of service in `iconv`.
- [CVE-2026-40200] is an out-of-bounds write in `qsort`.

Neither is relevant to Rust itself, but they could be used in mixed-
language projects that link with our `self-contained/libc.a`.

[CVE-2026-6042]: https://www.openwall.com/lists/oss-security/2026/04/09/19
[CVE-2026-40200]: https://www.openwall.com/lists/musl/2026/04/10/3
2026-04-11 15:25:37 -07:00
mejrs c4e4156037 Reduce size of ImportData 2026-04-11 21:14:45 +02:00
Jonathan Brouwer 58ca4df0bd Rollup merge of #155063 - josetorrs:refactor-alias-free, r=WaffleLapkin
`ty::Alias`: replace `def_id: did` with `def_id`

related issue: https://github.com/rust-lang/rust/issues/154941

tackling this task:

- [x] replace def_id: did with def_id where possible

r? @WaffleLapkin
2026-04-11 20:58:37 +02:00
Jonathan Brouwer 9a24dbf885 Rollup merge of #154925 - zachs18:heap-into-array-with-alloc, r=Mark-Simulacrum
Make Box/Rc/Arc::into_array allocator-aware (and add doctest)

Tracking issue for `alloc_slice_into_array`: https://github.com/rust-lang/rust/issues/148082

Tracking issue for `allocator_api`: https://github.com/rust-lang/rust/issues/32838

Make the `into_array` methods on `Box`, `Rc`, and `Arc` allocator-aware.

I think the allocator-aware-ness should not be observable on stable, so these should not be additionally (comment-)gated behind `feature(allocator_api)`, just like e.g. `Box::leak` and `Vec::into_boxed_slice`. The added doctests do not use `feature(allocator_api)`.

@rustbot label T-libs-api
2026-04-11 20:58:37 +02:00
Jonathan Brouwer 73a3824826 Rollup merge of #155130 - okaneco:stabilize_iso_high_one, r=Mark-Simulacrum
Stabilize feature `isolate_most_least_significant_one`

FCP completed https://github.com/rust-lang/rust/issues/136909#issuecomment-4224884128

Closes https://github.com/rust-lang/rust/issues/136909
2026-04-11 20:58:36 +02:00
Jonathan Brouwer 59b36a5283 Rollup merge of #154994 - dianne:no-dbg-temp, r=Mark-Simulacrum
don't leak internal temporaries from `dbg!`

Fixes rust-lang/rust#154988

r? @Mark-Simulacrum as the reviewer of https://github.com/rust-lang/rust/pull/154074
2026-04-11 20:58:35 +02:00
Jonathan Brouwer 197eb8c6c0 Rollup merge of #154967 - PaulDance:patches/fix-x86-win7-rwlock-max-test, r=Mark-Simulacrum
Test(lib/sync): Fix `test_rwlock_max_readers` for x86 Win7

The test recently added in rust-lang/rust#153555 currently systematically deadlocks when running it under i686 Windows 7, but not x86_64 that passes it fine. This therefore fixes the test for the target.

Empirically, the correct value for `MAX_READERS` seems to be `2^28 - 1`: removing the `- 1` re-introduces the deadlock, at least under our testing environment. This fix thus uses this value. However, I have no real justification to support that, because I find myself a bit at a loss when comparing the implementation details, the comment added above the test and what the current value is; some help would therefore be nice in this aspect. Also, the value change is restricted to 32-bit Win7 as there is no evidence to support it should be done for other targets.

cc @roblabla

@rustbot label O-windows-msvc O-windows-7 O-x86_32 A-atomic T-libs
2026-04-11 20:58:35 +02:00
Jonathan Brouwer 81578ef0c9 Rollup merge of #155057 - rust-wasi-web:update-libc-0.2.184, r=Mark-Simulacrum
Update libc to v0.2.184

This includes the WASI _SC_* sysconf constants needed for `thread::available_parallelism` on WASI targets (rust-lang/rust#153604).
2026-04-11 20:58:34 +02:00
Folkert de Vries aa656a91df Merge commit '0557e3478104037c76c2e5be7ea21e56ebbaff6e' into sync-from-portable-simd-2026-04-11 2026-04-11 20:28:28 +02:00
WilliamTakeshi a133bb8f27 replace @ ty::AliasTy matches with just args 2026-04-11 18:00:32 +00:00
Jose Torres ec582d5c1b replace def_id: did with def_id 2026-04-11 13:59:31 -04:00
Ben Kimock ff6191588a Use Vec::push_mut when adding a chunk to arenas 2026-04-11 12:58:21 -04:00
Folkert de Vries 0557e34781 Add f16 vector support (#513)
* Add `f16` vector support

* run `cargo update`

* disable `f16` tests on wasm32 with simd128

llvm hangs in that case, see https://github.com/llvm/llvm-project/issues/189251

* Add reference to LLVM issue causing f16 wasm ICE

---------

Co-authored-by: Caleb Zulawski <caleb.zulawski@gmail.com>
2026-04-11 11:13:30 -04:00
Takayuki Maeda 40a3ed1e14 propagate region resolution failures 2026-04-12 00:03:46 +09:00
Takayuki Maeda 8998c11244 add next-solver min-specialization region-resolution regression test 2026-04-12 00:03:26 +09:00
Mattia Pitossi 9371fea6e6 fix spurious test failure in metadata_access_times
* remove time assertion on SystemTime
* skip test only if when a time change occurs
2026-04-11 14:31:53 +00:00
ltdk 32d6c7fd60 Update hashbrown to 0.17 2026-04-11 10:00:32 -04:00
bors bf4fbfb7a1 Auto merge of #155149 - danieljofficial:move-tests-deref, r=Kivooeo
Move deref tests from issues into deref folder

Hi, Some deref tests, please look at them when you can
 r? @Kivooeo
2026-04-11 13:43:17 +00:00
Folkert de Vries 6bcd172f5a add cfg(target_object_format = "...") 2026-04-11 14:12:39 +02:00
danieljofficial cf986478fd add issue links and bless 2026-04-11 12:01:46 +01:00
danieljofficial c00aa3de46 move deref tests out of tests/ui/issues 2026-04-11 10:23:58 +01:00
bors 5f36a7f807 Auto merge of #155145 - jhpratt:rollup-atReM8h, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#154827 (distinguish "expected a single argument" and "expected an argument" on attribute parsing)
 - rust-lang/rust#155104 (bootstrap: auto-patch libgccjit.so for NixOS)
 - rust-lang/rust#155120 (Use a linting node closer the parsing of `#[cfg_attr]`)
2026-04-11 09:03:13 +00:00
Jacob Pratt b2088a21df Rollup merge of #155120 - Urgau:check-cfg-allow-cfg_attr-mod, r=JonathanBrouwer
Use a linting node closer the parsing of `#[cfg_attr]`

The parsing of `#[cfg_attr]` unconditionally used the crate-root as a linting node to attach lints, but the `unexpected_cfgs` lint can fire when parsing the attribute and users expect to be able to allow it at places other than the crate-root.

Let's instead use the linting node id, which is unfortunately always the parent but that's better than the crate-root when you are in a sub-module.

The parsing of `#[cfg]` and other already use the expansion linting node id, so no change required there.

Related to https://github.com/rust-lang/rust/issues/155118
2026-04-11 04:50:17 -04:00
Jacob Pratt 38ea36790f Rollup merge of #155104 - nbdd0121:bootstrap-gcc, r=Kobzol
bootstrap: auto-patch libgccjit.so for NixOS

Currently all downloaded rustc and LLVM components are auto patched on NixOS, but this is not done for libgccjit.so, so when GCC backend is enabled on NixOS, the build ICEs with errors like this:

    thread 'rustc' (2286205) panicked at compiler/rustc_codegen_gcc/src/lib.rs:191:9:
    Cannot load libgccjit.so: libzstd.so.1: cannot open shared object file: No such file or directory

Fix this by auto-patch libgccjit.so, too. `zstd` is added to the dependency environment.
2026-04-11 04:50:16 -04:00
Jacob Pratt ca34f771c0 Rollup merge of #154827 - scrabsha:push-zuosxmmnzkrq, r=jdonszelmann
distinguish "expected a single argument" and "expected an argument" on attribute parsing
2026-04-11 04:50:15 -04:00