Commit Graph

323757 Commits

Author SHA1 Message Date
Martin Nordholts ff73b8ac2b triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes
The test `tests/debuginfo/basic-stepping.rs` has a history of regressing
for subtle reasons, and has non-obvious expectations. So I'd like to
keep an extra eye on it.
2026-04-25 10:11:10 +02:00
bors 9620eae30a Auto merge of #155339 - JonathanBrouwer:rollup-2nyGW0a, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#155331 (Reformat `top_level_options!` and `options!` macro declarations)
 - rust-lang/rust#155332 (bump std libc to `0.2.185`)
 - rust-lang/rust#155286 (attribute cleanup: rustc_confusables)
 - rust-lang/rust#155306 (`CValue::zst()` - add missing "ZST" in docs)
 - rust-lang/rust#155311 (various small `rustc_expand` cleanups)
2026-04-15 14:53:37 +00:00
Jonathan Brouwer 439410f68a Rollup merge of #155311 - cyrgani:expand-clean, r=Kivooeo,petrochenkov
various small `rustc_expand` cleanups

Each commit should be reviewable on its own.
2026-04-15 14:39:09 +02:00
Jonathan Brouwer 420eec616f Rollup merge of #155306 - DanielEScherzer:cvalue-zst-article, r=JohnTitor
`CValue::zst()` - add missing "ZST" in docs
2026-04-15 14:39:08 +02:00
Jonathan Brouwer 1de718c323 Rollup merge of #155286 - mejrs:confusables, r=JonathanBrouwer
attribute cleanup: rustc_confusables

r? @jdonszelmann
2026-04-15 14:39:07 +02:00
Jonathan Brouwer 86fe9e259d Rollup merge of #155332 - folkertdev:bump-std-libc-0.2.185, r=tgross35
bump std libc to `0.2.185`

https://github.com/rust-lang/libc/releases/tag/0.2.185

r? tgross35
2026-04-15 14:39:06 +02:00
Jonathan Brouwer e4eff63647 Rollup merge of #155331 - Zalathar:options-fmt, r=petrochenkov
Reformat `top_level_options!` and `options!` macro declarations

These macros are already tricky, and having weird formatting doesn't help. Using a more regular style makes it easier to see where nesting begins and ends.

Extracted from https://github.com/rust-lang/rust/pull/154501 after the changes in https://github.com/rust-lang/rust/pull/149357 made rebasing very difficult.

There should be no change to compiler behaviour.
2026-04-15 14:39:06 +02: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
Folkert de Vries 2fe569d25f bump std libc to 0.2.185 2026-04-15 11:56:20 +02:00
Zalathar 4506131794 Reformat top_level_options! and options! macro declarations 2026-04-15 18:33:48 +10: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
cyrgani 2e3036dc54 merge if and while conditions 2026-04-14 20:45:04 +00:00
Daniel Scherzer bd712bd224 CValue::zst() - add missing "ZST" in docs 2026-04-14 13:22:50 -07:00
cyrgani 3dcd8ffe88 deduplicate internal feature check 2026-04-14 19:58:15 +00:00
cyrgani 6e458a5fca simplify make_stmts_default! 2026-04-14 19:48:17 +00: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
mejrs f17ca97749 attribute cleanup: rustc_confusables 2026-04-14 14:24:26 +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
cyrgani f4780504cd add and use PanicMessage::into_string 2026-04-14 11:16:33 +00:00
cyrgani a681f34d4b add helper for profiling calls 2026-04-14 11:16:33 +00:00