Commit Graph

323742 Commits

Author SHA1 Message Date
Balt 4095bbdd2d Add new Layout methods to release notes 2026-04-15 11:48:40 -05:00
Balt fba9ef8702 Add insert_mut to release notes
Co-authored-by: Josh Stone <cuviper@gmail.com>
2026-04-15 11:38:59 -05:00
Balt e910c38861 Add push_mut to release notes 2026-04-15 11:32:54 -05:00
bors 32e4c0ecbd Auto merge of #155256 - cuviper:hashbrown-0.17, r=Mark-Simulacrum
compiler: update hashbrown to 0.17

See library's rust-lang/rust#155154 for the bug fixes this brings.
This PR also updates `indexmap` in the compiler as a direct dependent.
2026-04-15 11:01:30 +00:00
bors 57cb10ae1e Auto merge of #155324 - jhpratt:rollup-BNB8Pcb, r=jhpratt
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#154882 (Gate tuple const params behind `min_adt_const_params` feature)
 - rust-lang/rust#155259 (explicit-tail-calls: disable two tests on LoongArch)
 - rust-lang/rust#155293 (fix arch names in cfg pretty printer)
 - rust-lang/rust#155314 (`BorrowedBuf`: Update outdated safety comments in `set_init` users.)
 - rust-lang/rust#153469 (docs: clarify path search behavior in std::process::Command::new)
 - rust-lang/rust#154765 (Clarify ascii whitespace exclusion of vertical tab in the doc)
 - rust-lang/rust#155172 (Some small nits for supertrait_item_shadowing, and additional testing)
 - rust-lang/rust#155279 (Test/lexer unicode pattern white space)
 - rust-lang/rust#155280 (Tests for precise-capture through RPIT and TAIT)
 - rust-lang/rust#155301 (Delete unused `rustc_trait_selection` errors.)
 - rust-lang/rust#155303 (remove ibraheemdev from review rotation)
 - rust-lang/rust#155304 (remove PointeeParser)
 - rust-lang/rust#155319 (Remove dead diagnostic structs.)
2026-04-15 05:15:32 +00:00
Jacob Pratt aeaa84995e Rollup merge of #155319 - nnethercote:rm-dead-error-structs, r=Kivooeo
Remove dead diagnostic structs.

One of these has a "FIXME(autodiff): I should get used somewhere" comment, but I figure YAGNI applies and it's so small that reinstating it if necessary would be trivial.

r? @Kivooeo
2026-04-14 23:02:37 -04:00
Jacob Pratt e20fc9c303 Rollup merge of #155304 - Bryntet:remove-pointee-parser, r=JonathanBrouwer
remove PointeeParser

this parser does nothing currently, as the current scope of `rustc_attr_parsing` only includes builtin attributes, and not derive macros

it isn't defined in `compiler/rustc_feature/src/builtin_attrs.rs`

all the actual parsing for `#[pointee]` is actually handled in `compiler/rustc_builtin_macros/src/deriving/coerce_pointee.rs`

r? @JonathanBrouwer
2026-04-14 23:02:37 -04:00
Jacob Pratt edeacddbc7 Rollup merge of #155303 - WaffleLapkin:ibraheemdev, r=tgross35
remove ibraheemdev from review rotation

@ibraheemdev haven't reviewed any r-l/r PRs since October last year and has a backlog of [8 PRs at the moment of writing this](https://github.com/rust-lang/rust/pulls?q=is%3Aopen+is%3Apr+assignee%3Aibraheemdev+label%3AS-waiting-on-review).

@ibraheemdev thank you for the reviews that you have done in the past! feel free to re-add yourself once you have time for this again :)
2026-04-14 23:02:36 -04:00
Jacob Pratt 3002472a77 Rollup merge of #155301 - mejrs:dead, r=nnethercote
Delete unused `rustc_trait_selection` errors.

The first two of these are duplicated elsewhere in some form or another, apparently they became orphaned during various moves and refactors. The third is just never used.
2026-04-14 23:02:35 -04:00
Jacob Pratt 900e3a7720 Rollup merge of #155280 - Zalathar:opaque-capture-bug, r=JonathanBrouwer
Tests for precise-capture through RPIT and TAIT

- Tests for https://github.com/rust-lang/rust/issues/155151.

These tests succeed under `-Znext-solver`, but incorrectly fail under the old trait solver.

---

The bug can be triggered via return-position `impl Trait` on stable, but requires some rather contrived code. When using type-alias `impl Trait`, it's easier to imagine the issue being triggered by real code.
2026-04-14 23:02:35 -04:00
Jacob Pratt 07f5dcaac7 Rollup merge of #155279 - Sandijigs:test/lexer-unicode-pattern-white-space, r=jdonszelmann
Test/lexer unicode pattern white space

This PR adds a test for the Rust lexer to verify it correctly accepts vertical tab (`\x0B`) as valid whitespace between tokens. Vertical tab is part of Unicode Pattern_White_Space, which the Rust language specification uses to define whitespace.

Related: Outreachy tracking [Pattern_White_Space](https://www.unicode.org/reports/tr31/#R3a)
2026-04-14 23:02:34 -04:00
Jacob Pratt 5cff48a164 Rollup merge of #155172 - jackh726:supertrait-shadowing-cleanup, r=lcnr
Some small nits for supertrait_item_shadowing, and additional testing

cc rust-lang/rust#89151

r? types
2026-04-14 23:02:33 -04:00
Jacob Pratt 78a1300310 Rollup merge of #154765 - krtab:doc_ascii_whitespace, r=Mark-Simulacrum,WaffleLapkin
Clarify ascii whitespace exclusion of vertical tab in the doc

This especially means that for `c: char`, `c.is_ascii() && c.is_whitespace()` does **not** imply `c.is_ascii_whitespace()`, which can cause bug and is highly counterintuitive.
2026-04-14 23:02:33 -04:00
Jacob Pratt 3f19aa5672 Rollup merge of #153469 - Albab-Hasan:doc/command-path-search-behavior, r=ChrisDenton
docs: clarify path search behavior in std::process::Command::new

the existing docs mentioned that `PATH` is searched in an "os defined way" and that it could be controlled by setting PATH on the command but never explained which `PATH` is actually used.

on unix the key thing to understand is that when you modify the childs environment (via `env()`, `env_remove()`, or `env_clear()`), the `PATH` search uses whatever `PATH` ends up in the child's environment not the parents. so if you call `env_clear()` and forget to set `PATH`, you don't get the parents `PATH` as a fallback; you get the OS default (typically `/bin:/usr/bin`) which often won't find what you need.

the three cases are now documented:
- unmodified env: child inherits parents `PATH`, that gets searched
- `PATH` explicitly set `via env()`: the new value is searched
- `PATH` removed (`env_clear` or `env_remove`): falls back to OS default, not the parents `PATH`

on windows rust resolves the executable before spawning rather than letting `CreateProcessW` do it. the search order is: childs `PATH` (if explicitly set) first then system-defined directories then the parents `PATH`. the existing note about issue rust-lang/rust#37519 is preserved.

limitations in this doc:
- the unix fallback path behavior ("typically `/bin:/usr/bin`") is verified for linux/glibc. behavior on macOS, BSD, and musl is similar in practice but not fully confirmed here.
- the windows search order is summarized as "system-defined directories" which actually includes the application directory (the directory of the calling process's executable) as a distinct step before the system dirs that detail is omitted for brevity.
- `posix_spawnp` `PATH` source (calling process environ vs envp argument) is ambiguous in the `POSIX` spec; the behavior here is inferred from the guard in `unix.rs` that bypasses `posix_spawn` when `PATH` has been modified.

closes rust-lang/rust#137286 (hopefully)
2026-04-14 23:02:32 -04:00
Jacob Pratt 85c11f656b Rollup merge of #155314 - briansmith:b/comments, r=joshtriplett
`BorrowedBuf`: Update outdated safety comments in `set_init` users.

These comments appear to have been written before `BorrowedBuf`'s init tracking was simplified in
https://github.com/rust-lang/rust/pull/150129. The `BufWriter` comment of the usage within `BufWriter` will be handled separately.

CC rust-lang/rust#78485, rust-lang/rust#117693.
2026-04-14 23:02:31 -04:00
Jacob Pratt 48865507d0 Rollup merge of #155293 - usamoi:rustdoc-loongarch, r=GuillaumeGomez
fix arch names in cfg pretty printer

It's introduced in https://github.com/rust-lang/rust/pull/154328.

@rustbot label +beta-nominated

(it affects the documentation of [`core::arch::loongarch32`](https://doc.rust-lang.org/beta/core/arch/loongarch32/index.html) and [`core::arch::loongarch64`](https://doc.rust-lang.org/beta/core/arch/loongarch64/index.html))
2026-04-14 23:02:31 -04:00
Jacob Pratt de84f87874 Rollup merge of #155259 - durin42:llvm-23-loongarch-tailcall, r=chenyukang
explicit-tail-calls: disable two tests on LoongArch

A [recent LLVM change](https://github.com/llvm/llvm-project/pull/191508) broke these on LLVM 23.

I suspect these will eventually be fixed, so maybe it'd be okay/better to just leave this pending so it applies to our CI without merging it? I'm open to opinions.
2026-04-14 23:02:30 -04:00
Jacob Pratt c6363238fa Rollup merge of #154882 - zedddie:gate-tuple-const-params, r=BoxyUwU
Gate tuple const params behind `min_adt_const_params` feature

r? BoxyUwU
2026-04-14 23:02:30 -04:00
bors bd1e7c7948 Auto merge of #153815 - GokhanKabar:fix-ice-enum-discr-generic-self, r=BoxyUwU
Fix ICE when Self is used in enum discriminant of a generic enum



Fixes rust-lang/rust#153756
Let discriminant AnonConst inherit parent generics via Node::Variant in generics_of, and emit a proper error instead of span_bug! for the TooGeneric case in wfcheck.
2026-04-15 01:58:56 +00:00
Nicholas Nethercote f093767036 Remove dead diagnostic structs.
One of these has a "FIXME(autodiff): I should get used somewhere"
comment, but I figure YAGNI applies and it's so small that reinstating
it if necessary would be trivial.
2026-04-15 08:54:46 +10:00
Brian Smith 10cff1530d BorrowedBuf: Update outdated safety comments in set_init users.
These comments appear to have been written before `BorrowedBuf`'s
init tracking was simplified in
https://github.com/rust-lang/rust/pull/150129. The `BufWriter` comment
of the usage within `BufWriter` will be handled separately.
2026-04-14 14:59:21 -07:00
Edvin Bryntesson 2598b50f92 remove PointeeParser 2026-04-14 20:25:43 +02:00
Waffle Lapkin 0a0dc9e13c remove ibraheemdev from review rotation 2026-04-14 20:03:24 +02:00
Albab Hasan a34d15f423 Update library/std/src/process.rs
Co-authored-by: Chris Denton <chris@chrisdenton.dev>
2026-04-14 23:39:04 +06:00
mejrs c8c4f02d00 Delete unused rustc_trait_selection errors. 2026-04-14 19:33:36 +02:00
albab-hasan 97761a0c23 docs: move PATH search details under Platform-specific behavior, add stability
caveat
2026-04-14 23:02:47 +06:00
bors a5c825cd82 Auto merge of #155292 - JonathanBrouwer:rollup-AJQWqfn, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#154049 (delegation: Track more precise spans for glob delegations)
 - rust-lang/rust#155134 (Replace custom trim_ascii_start with the standard library method)
 - rust-lang/rust#155235 (add the `fma4` x86 target feature)
 - rust-lang/rust#155218 (coroutines: Skip the closure signature annotation check for tainted bodies)
 - rust-lang/rust#155274 (limit duplicate-profiler-builtins test to targets that can do dynamic linking)
 - rust-lang/rust#155276 (`#[rustc_must_match_exhaustively]` detect let else)
 - rust-lang/rust#155281 (Revert "allow `windows-gnu` targets to embed gdb visualizer scripts")
2026-04-14 15:41:02 +00:00
usamoi 05081b96c9 fix arch names in cfg pretty printer 2026-04-14 23:38:25 +08:00
GokhanKabar aacac7e2e3 Fix ICE when Self is used in enum discriminant of a generic enum
* Fix ICE when Self is used in enum discriminant of a generic enum

Move the validation into the existing `check_param_uses_if_mcg` machinery
in HIR ty lowering instead of adding a new check in wfcheck. After the
`AnonConstKind` refactoring, `ForbidMCGParamUsesFolder` was only gated on
`AnonConstKind::MCG`, causing discriminant anon consts (`NonTypeSystem`) to
bypass it entirely.

Add `anon_const_forbids_generic_params()` which returns the appropriate
`ForbidParamContext` for both MCG and enum discriminant contexts. Wire it
into `check_param_uses_if_mcg` so that `Self` aliasing a generic type is
caught before reaching `const_eval_poly`. Convert the `TooGeneric` span_bug
into a proper diagnostic as a fallback for anything slipping through
type-dependent path resolution.
* Address review comments

- Rename `ForbidMCGParamUsesFolder` to `ForbidParamUsesFolder`
- Rename `MinConstGenerics` variant to `ConstArgument` with updated doc
- Simplify doc comment on `anon_const_forbids_generic_params`
- Make match on `AnonConstKind` exhaustive
- Move `anon_const_def_id` inside the `if let` in `check_param_uses_if_mcg`
- Remove now-unreachable `TooGeneric` span_err in wfcheck
* Revert TooGeneric arm back to span_bug! as requested by reviewer
* Use generics_of to determine if NonTypeSystem anon consts allow generic params
* Also check InlineConst and Closure defs nested in enum discriminants
* Simplify logic for determining anonymous constant parent in generic contexts
* add test
2026-04-14 14:32:11 +00:00
Jonathan Brouwer 2d27fe6a5e Rollup merge of #155281 - folkertdev:revert-154840, r=folkertdev
Revert "allow `windows-gnu` targets to embed gdb visualizer scripts"

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

This reverts commit 472b966548.

This was merged as https://github.com/rust-lang/rust/pull/154840, but causes linker errors in the wild.

cc @Walnut356 @mati865
r? @ghost
2026-04-14 16:29:37 +02:00
Jonathan Brouwer 960a56fc4c Rollup merge of #155276 - jdonszelmann:must-match-exhaustively-let-else, r=JonathanBrouwer
`#[rustc_must_match_exhaustively]` detect let else

Extension of https://github.com/rust-lang/rust/pull/155047, I forgor to lint on let-else :3
2026-04-14 16:29:36 +02:00
Jonathan Brouwer 10e6d6c7d9 Rollup merge of #155274 - tshepang:patch-1, r=lqd
limit duplicate-profiler-builtins test to targets that can do dynamic linking

this is the error I got for an example of such a target
```
=== STDERR ===
error: extern location for dylib_a does not exist: libdylib_a.so
 --> main.rs:2:5
  |
2 |     dylib_a::something();
  |     ^^^^^^^

error: extern location for dylib_b does not exist: libdylib_b.so
 --> main.rs:3:5
  |
3 |     dylib_b::something_else();
  |     ^^^^^^^
2026-04-14 16:29:35 +02:00
Jonathan Brouwer aed02c58fc Rollup merge of #155218 - jakubadamw:issue-139570, r=tiif
coroutines: Skip the closure signature annotation check for tainted bodies

When a coroutine has too many parameters, `check_match` fails and `construct_error` builds a MIR body with only the coroutine's computed arguments (env + resume type). The user-provided signature, however, still reflects all the parameters the user wrote. `check_signature_annotation` then tries to `zip_eq` these two mismatched iterators, causing a panic. Checking `tainted_by_errors` and bailing early avoids this, since `construct_error` bodies cannot meaningfully be compared against user annotations.

Example currently ICEing:

```rust
fn main() {
    |(1, 42), ()| yield;
}
```

Closes rust-lang/rust#139570.
2026-04-14 16:29:34 +02:00
Jonathan Brouwer b7286260c8 Rollup merge of #155235 - folkertdev:fma4-target-feature, r=sayantn
add the `fma4` x86 target feature

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

Implications are based on LLVM

https://github.com/llvm/llvm-project/blob/df6c82053c5e1f9814d130d423f34871bc6423c5/llvm/lib/Target/X86/X86.td#L201-L206

This feature adds a slightly better instruction encoding for fma. We might want to expose the intrinsics in `stdarch` with that target feature, but just adding the target feature in user code should already take advantage of this improved encoding.

This target feature is used in `libm`.

r? sayantn
2026-04-14 16:29:33 +02:00
Jonathan Brouwer 5da0b6cf1c Rollup merge of #155134 - thebabalola:fix/replace-trim-ascii-start-with-stdlib, r=mati865
Replace custom trim_ascii_start with the standard library method

The markdown parser in `rustc_errors` has a local `trim_ascii_start` function that strips leading ASCII whitespace from a byte slice. The standard library has had `<[u8]>::trim_ascii_start()` since Rust 1.80, which does the same thing.

This PR removes the custom function and calls the stdlib method directly in `parse_unordered_li` and `parse_ordered_li`. No behaviour change.

I also added a test covering the list item leading-whitespace trimming behaviour, including a tab case.

Fixes rustfoundation/interop-initiative#53
2026-04-14 16:29:32 +02:00
Jonathan Brouwer 49da27c336 Rollup merge of #154049 - petrochenkov:deleglobspan, r=jackh726
delegation: Track more precise spans for glob delegations

The last commit also fixes a macro hygiene issue with `self` in delegations found in https://github.com/rust-lang/rust/pull/154002.
2026-04-14 16:29:31 +02:00
Folkert de Vries 17f5fa0dd4 Revert "allow windows-gnu targets to embed gdb visualizer scripts"
This reverts commit 472b966548.
2026-04-14 13:27:46 +02:00
Zalathar 15fd168ee0 Tests for precise-capture through RPIT and TAIT 2026-04-14 21:14:10 +10:00
Sandijigs 7d4b12b600 Add lexer test for vertical tab as Pattern_White_Space whitespace 2026-04-14 11:49:28 +01:00
Jana Dönszelmann 26a0fdcdcd fixup let-else on typing mode in the compiler 2026-04-14 11:05:19 +02:00
Jana Dönszelmann 778d27441d also check let-else 2026-04-14 11:05:19 +02:00
bors 12f35ad39e Auto merge of #155209 - JonathanBrouwer:attr_cleanup2, r=jdonszelmann
Post-attribute ports cleanup pt. 1 (again)

This is a re-implementation of most (but not all) of https://github.com/rust-lang/rust/pull/154808

The code is the same as in that PR, other than a few changes, I'll leave comments where I changed things.
I did re-implement most of the commits rather than cherry-picking, so it's probably good to check the entire diff regardless

r? @jdonszelmann
2026-04-14 08:59:40 +00:00
Tshepang Mbambo 8619841f05 limit duplicate-profiler-builtins test to targets that can do dynamic linking 2026-04-14 10:57:46 +02:00
Vadim Petrochenkov f001d789c8 Update some tests after rebase 2026-04-14 11:33:15 +03:00
Vadim Petrochenkov 166c499a47 delegation: Give declaration of self syntax context of the delegation body
Instead of the last segment of the delegation path.
`self` is something that introduced by the whole delegation item, not some specific part of it, and the last segment may need to have a different context for path resolution purposes.
2026-04-14 11:32:34 +03:00
Vadim Petrochenkov 8114c5dc2e expand: More precise location for glob delegation
The span location of the last segment in the desugared path is inherited from the star symbol's span
2026-04-14 11:32:34 +03:00
Vadim Petrochenkov 7114404a26 ast: Preserve the star symbol span in glob delegation items 2026-04-14 11:32:33 +03:00
bors 7db0ab43a7 Auto merge of #155270 - jhpratt:rollup-Djg7HpJ, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#152530 (Use the term struct-like variant instead of anonymous structs for data of struct-like enum variants)
 - rust-lang/rust#155005 (preserve SIMD element type information)
 - rust-lang/rust#155230 (Avoid linting `doc_cfg` as unused in rustc)
2026-04-14 04:56:46 +00:00
Jacob Pratt ec3a6b407f Rollup merge of #155230 - TaKO8Ki:fix-unused-features-doc-cfg, r=Kivooeo
Avoid linting `doc_cfg` as unused in rustc

Fixes rust-lang/rust#154487

https://github.com/rust-lang/rust/blob/af80b0f2cd0505bcc86eaa675d1ab403110d373a/src/librustdoc/passes/propagate_doc_cfg.rs#L19-L26
2026-04-14 00:37:25 -04:00
Jacob Pratt 803a7227fb Rollup merge of #155005 - folkertdev:simd-element-type-llvm, r=nnethercote
preserve SIMD element type information

Preserve the SIMD element type and provide it to LLVM for better optimization.

This is relevant for AArch64 types like `int16x4x2_t`, see also https://github.com/llvm/llvm-project/issues/181514. Such types are defined like so:

```rust
#[repr(simd)]
struct int16x4_t([i16; 4]);

#[repr(C)]
struct int16x4x2_t(pub int16x4_t, pub int16x4_t);
```

Previously this would be translated to the opaque `[2 x <8 x i8>]`, with this PR it is instead `[2 x <4 x i16>]`. That change is not relevant for the ABI, but using the correct type prevents bitcasts that can (indeed, do) confuse the LLVM pattern matcher.

This change will make it possible to implement the deinterleaving loads on AArch64 in a portable way (without neon-specific intrinsics), which means that e.g. Miri or the cranelift backend can run them without additional support.

discussion at [#t-compiler > loss of vector element type information](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/loss.20of.20vector.20element.20type.20information/with/584483611)
2026-04-14 00:37:24 -04:00