3699 Commits

Author SHA1 Message Date
bors 38799a320d Auto merge of #155519 - JonathanBrouwer:rollup-P17uwTS, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#155370 (Add regression test for dead code elimination with drop + panic)
 - rust-lang/rust#154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser)
 - rust-lang/rust#155294 (Add test for coalescing of diagnostic attribute duplicates)
 - rust-lang/rust#155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`)
 - rust-lang/rust#155431 (Add temporary scope to assert_matches)
 - rust-lang/rust#153873 (deprecate `std::char` constants and functions)
 - rust-lang/rust#154865 (libtest: use binary search for --exact test filtering)
 - rust-lang/rust#154979 (add #[must_use] macros for floats)
 - rust-lang/rust#155486 (c-variadic: add roundtrip test)
 - rust-lang/rust#155504 (Remove `AttributeLintKind` variants - part 2)
 - rust-lang/rust#155510 (Update Tidy python executable path)
 - rust-lang/rust#155514 (codegen-options docs: remove -Csoft-float)
2026-04-19 16:04:18 +00:00
Jonathan Brouwer 0883b8cc79 Rollup merge of #154823 - jakubadamw:spdx-rs-replacement, r=Mark-Simulacrum
Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser

The spdx-rs crate [is no longer maintained](https://github.com/doubleopen-project/spdx-rs/pulls) and is behind on its own dependency updates. It is currently used in [the collect-license-metadata tool](https://github.com/rust-lang/rust/tree/main/src/tools/collect-license-metadata), employing a single function therefrom: `spdx_rs::parsers::spdx_from_tag_value`, which parses the output of the `reuse` tool to extract file names, licences and copyright text.

This PR replaces the use of said function with a small minimal parser that handles just the subset of the SPDX tag-value format that is needed: `Tag: Value` line pairs and multi-line `<text>...</text>` blocks.

Coincidentally, this gets rid of the last transitive dependency on syn v1.
2026-04-19 16:04:29 +02:00
bors 22cc6747b1 Auto merge of #155444 - bjorn3:update_deps, r=jieyouxu
Update a bunch of dependencies to reduce windows-sys duplication

This gets rid of windows-sys 0.60 and with the exception of curl and stacker it gets rid of windows-sys 0.59. For stacker getting rid of windows-sys 0.59 is blocked on https://github.com/rust-lang/stacker/pull/145 and https://github.com/rust-lang/rust/pull/155438.
2026-04-19 12:46:26 +00:00
bors 6f109d8a2d Auto merge of #155223 - teor2345:fndef-refactor, r=mati865
Refactor FnDecl and FnSig non-type fields into a new wrapper type





#### Why this Refactor?

This PR is part of an initial cleanup for the [arg splat experiment](https://github.com/rust-lang/rust/issues/153629), but it's a useful refactor by itself.

It refactors the non-type fields of `FnDecl`, `FnSig`, and `FnHeader` into a new packed wrapper types, based on this comment in the `splat` experiment PR:
https://github.com/rust-lang/rust/pull/153697#discussion_r3004637413

It also refactors some common `FnSig` creation settings into their own methods. I did this instead of creating a struct with defaults.

#### Relationship to `splat` Experiment

I don't think we can use functional struct updates (`..default()`) to create `FnDecl` and `FnSig`, because we need the bit-packing for the `splat` experiment.

Bit-packing will avoid breaking "type is small" assertions for commonly used types when `splat` is added.
This PR packs these types:
- ExternAbi: enum + `unwind` variants (38) -> 6 bits
- ImplicitSelfKind: enum variants (5) -> 3 bits
- lifetime_elision_allowed, safety, c_variadic: bool -> 1 bit

#### Minor Changes

Fixes some typos, and applies rustfmt to clippy files that got skipped somehow.
2026-04-18 23:46:37 +00:00
Jonathan Brouwer d12af208b9 Rollup merge of #154432 - GuillaumeGomez:try-rm-AttributeLint, r=JonathanBrouwer
Set up API to make it possible to pass closures instead of `AttributeLint`

Part of https://github.com/rust-lang/rust/issues/153099.

This PR sets up the base implementations needed to remove `AttributeLintKind` entirely and migrate two variants as examples.

r? @JonathanBrouwer
2026-04-18 11:41:30 +02:00
Guillaume Gomez c5b9918540 Set up API to make it possible to pass closures instead of AttributeLint.
The end goal being to completely remove `AttributeLint`.
2026-04-17 23:43:06 +02:00
bjorn3 57966e987c Almost fully get rid of windows-sys 0.59
Only curl and stacker still depends on it.
2026-04-17 16:10:07 +02:00
bjorn3 bed52c181d Get rid of windows-sys 0.60 in the main workspace 2026-04-17 16:06:36 +02:00
Philipp Krones 760db10f1e Update Cargo.lock 2026-04-16 19:49:04 +02:00
teor dafb6bb801 Refactor FnDecl and FnSig flags into packed structs 2026-04-16 07:08:08 +10: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
Josh Stone 6e618bea47 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-13 11:11:16 -07:00
Jonathan Brouwer f8a8c9e244 Rollup merge of #155003 - malezjaa:update-thinvec, r=davidtwco
update thin-vec

With thin-vec v0.2.15 released, copy-pasted implementation of ExtractIf can be removed.
2026-04-13 14:02:35 +02:00
Jacob Adam 8712a92427 Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser
The spdx-rs crate is no longer maintained and is behind on its own dependency
updates. The only function that collect-license-metadata uses from it is
`spdx_rs::parsers::spdx_from_tag_value`, which parses the output of the `reuse`
tool to extract file names, licences and copyright text.

Replace this with a small minimal parser that handles just the subset
of the SPDX tag-value format that is needed: `Tag: Value` line pairs
and multi-line `<text>...</text>` blocks.

Coincidentally, this gets rid of the last transitive dependency on syn v1.
2026-04-12 22:06:46 +01:00
bors 02c7f9bec0 Auto merge of #155115 - JonathanBrouwer:rollup-RePrRPQ, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152901 (Introduce a `#[diagnostic::on_unknown]` attribute)
 - rust-lang/rust#155078 (Reject dangling attributes in where clauses)
 - rust-lang/rust#154449 (Invert dependency between `rustc_errors` and `rustc_abi`.)
 - rust-lang/rust#154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing)
 - rust-lang/rust#154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths)
 - rust-lang/rust#155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
2026-04-10 18:19:03 +00:00
Jonathan Brouwer 197fb1b0d7 Rollup merge of #154449 - nnethercote:rustc_errors-dep-rustc_abi, r=davidtwco
Invert dependency between `rustc_errors` and `rustc_abi`.

Currently, `rustc_errors` depends on `rustc_abi`, which depends on `rustc_error_messages`. This is a bit odd.

`rustc_errors` depends on `rustc_abi` for a single reason: `rustc_abi` defines a type `TargetDataLayoutErrors` and `rustc_errors` impls `Diagnostic` for that type.

We can get a more natural relationship by inverting the dependency, moving the `Diagnostic` trait upstream. Then `rustc_abi` defines `TargetDataLayoutErrors` and also impls `Diagnostic` for it. `rustc_errors` is already pretty far upstream in the crate graph, it doesn't hurt to push it a little further because errors are a very low-level concept.

r? @davidtwco
2026-04-10 18:38:13 +02:00
León Orell Valerian Liehr 64b4284df3 Simplify impl of dump_symbol_names_and_def_paths 2026-04-10 12:14:40 +02:00
Jonathan Brouwer 65745a1b95 Revert #152369 because of multiple regressions
The regressions are documented in the PR comments.
This reverts commit 2972b5e, reversing changes made to f908263.
2026-04-09 18:53:59 +02:00
malezjaa 39f7cdb8e6 update thin-vec 2026-04-08 21:09:07 +02:00
bors e26dedca9d Auto merge of #154914 - Muscraft:update-annotate-snippets, r=jieyouxu
chore: Update annotate-snippets to 0.12.15

This PR updates `annotate-snippets` to [`0.12.15`](https://github.com/rust-lang/annotate-snippets-rs/blob/main/CHANGELOG.md#01215---2026-04-06), which includes a fix for rust-lang/rust#154258, as well as a number of other fixes over [`0.12.10`](https://github.com/rust-lang/annotate-snippets-rs/blob/main/CHANGELOG.md#01210---2025-12-01).

fixes rust-lang/rust#154258
2026-04-08 10:15:57 +00:00
Scott Schafer 63ed113d84 chore: Update annotate-snippets to 0.12.15 2026-04-06 14:48:52 -06:00
Alex Crichton 262d35bda5 Update wasm-component-ld to 0.5.22
Same as 147495, just keeping it up-to-date.
2026-04-06 07:17:00 -07:00
Jonathan Brouwer f359441c73 Rollup merge of #154830 - RalfJung:miri, r=RalfJung
miri subtree update

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

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

r? @ghost
2026-04-05 00:18:46 +02:00
Ralf Jung 21256d86e4 update lockfile 2026-04-04 22:52:56 +02:00
Edvin Bryntesson 58168028f9 add field attr_id to attr parser's AcceptContext 2026-04-03 11:08:10 +02:00
bors 009a6c1e8b Auto merge of #154308 - ShoyuVanilla:undo-fudge-iv, r=jieyouxu
Revert #151380 and #153869

cc https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23153869.3A.20beta-nominated/with/581306395

r? ghost
2026-04-02 00:09:59 +00:00
bors 0e95a0f4c6 Auto merge of #154637 - JonathanBrouwer:rollup-fGsU36o, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#154419 (Take first task group for further execution)
 - rust-lang/rust#154569 (Fix  type alias where clause suggestion spacing issue)
 - rust-lang/rust#154617 (Update flate2 users to use zlib-rs)
 - rust-lang/rust#154618 (Fix AtomicPtr::update's cfg gate)
 - rust-lang/rust#154620 (stabilize new Range type and iterator)
 - rust-lang/rust#151932 (refactor: remove `Adjust::ReborrowPin`)
 - rust-lang/rust#153980 (refactor: move doc(rust_logo) check to parser)
 - rust-lang/rust#154134 (fix: guard paren-sugar pretty-printing on short trait args)
 - rust-lang/rust#154270 (Create `Ty` type alias in `rustc_type_ir`)
 - rust-lang/rust#154580 (Split AttributeParserError Diagnostic implementation into subfunctions)
 - rust-lang/rust#154606 (misc test cleanups)
 - rust-lang/rust#154612 (Add a test for a now fixed ICE with `offset_of!()`)
2026-03-31 16:44:16 +00:00
Josh Triplett 722b2d3626 Cargo.lock: Update for zlib-rs 2026-03-30 18:43:16 -07:00
Ralf Jung 79d00dbf25 update lockfile 2026-03-30 14:48:37 +02:00
Nicholas Nethercote b711f5689f Invert dependency between rustc_errors and rustc_abi.
Currently, `rustc_errors` depends on `rustc_abi`, which depends on
`rustc_error_messages`. This is a bit odd.

`rustc_errors` depends on `rustc_abi` for a single reason: `rustc_abi`
defines a type `TargetDataLayoutErrors` and `rustc_errors` impls
`Diagnostic` for that type.

We can get a more natural relationship by inverting the dependency,
moving the `Diagnostic` trait upstream. Then `rustc_abi` defines
`TargetDataLayoutErrors` and also impls `Diagnostic` for it.
`rustc_errors` is already pretty far upstream in the crate graph, it
doesn't hurt to push it a little further because errors are a very
low-level concept.
2026-03-30 14:15:36 +11:00
Stuart Cook e0a0ad188d Rollup merge of #154488 - Zalathar:unstable, r=jieyouxu
Revert "Unstable book options parser"

- Reverts https://github.com/rust-lang/rust/pull/154070

This reverts commit 6fd8466768, reversing changes made to fda6d37bb8.

---

The changes in https://github.com/rust-lang/rust/pull/154070 are well-intentioned, but in their current form they place an unreasonable maintenance burden on the affected part of the compiler, out of proportion to the benefit gained.

- Moving the unstable options to a separate `include!` file is marginally more convenient for the unstable-book-gen tool, but a big hassle for compiler contributors looking to read or modify the list of unstable options. It breaks normal file layout conventions, interferes with navigation, and interferes with IDE features, all without ever being truly necessary.

- The extra `syn`-based parser in unstable-book-gen is quite complicated, almost entirely undocumented, and seemingly buggy. That makes it extremely difficult to understand or modify, which in turn makes it effectively impossible to ever change the `options!` macro on the compiler side.

- The new tests in unstable-book-gen don't appear to be hooked up to run in CI.

- The compiler changes don't appear to have been approved by a T-compiler reviewer.

Before contemplating a revert, I tried to put together a fix-forward to resolve or mitigate some of these issues. But unstable-book-gen in its current state makes that impractical, so unfortunately I believe that the only way forward is to revert the original changes.

---

I do think the reverted functionality is potentially useful, and I'm not fundamentally opposed to a revised version of it landing in the future, if the relevant concerns are addressed.

But I feel strongly that the current version does not justify the real and troublesome maintenance burden that it imposes on compiler contributors.
2026-03-28 15:01:40 +11:00
Stuart Cook 624c3c010e Rollup merge of #154396 - xtqqczze:deps/tar, r=clubby789
chore(deps): update rust crate tar to v0.4.45

Fix [RUSTSEC-2026-0068](https://rustsec.org/advisories/RUSTSEC-2026-0068.html): tar-rs incorrectly ignores PAX size headers if header size is nonzero
Fix [RUSTSEC-2026-0067](https://rustsec.org/advisories/RUSTSEC-2026-0067.html): `unpack_in` can chmod arbitrary directories by following symlinks
2026-03-28 15:01:40 +11:00
Zalathar d470684a43 Revert "Unstable book options parser"
This reverts commit 6fd8466768, reversing
changes made to fda6d37bb8.
2026-03-28 14:18:26 +11:00
León Orell Valerian Liehr 6fd8466768 Rollup merge of #154070 - mehdiakiki:unstable-book-options-parser, r=clubby789
Unstable book options parser

Parses the `options!` macro in `compiler/rustc_session/src/options.rs` directly to extract the unstable (-Z) compiler flag names and descriptions to generate documentation for the unstable book.

I took notice from the previous attempt which ran `rustc -Zhelp` and parsed the output and used this approach that reads the source directly.

Used claude for the tedious char by char parsing parts but verified the code, I hope that's ok!
2026-03-27 15:11:53 +01:00
xtqqczze afe3ab6ac5 chore(deps): update rust crate tar to v0.4.45 2026-03-27 13:36:27 +00:00
Nicholas Nethercote a733192980 Make rustc_hir_analysis not depend on rustc_lint.
`rustc_hir_analysis` depends on `rustc_lint` in just a single function:
`emit_delayed_lint`, which is used by the
"emit_ast_lowering_delayed_lints" checking section within
`rustc_hir_analysis::check_crate`.

This commit moves that function and section to out of
`rustc_hir_analysis::check_crate`, into `rustc_interface`, eliminating
the dependency. This seems reasonable because the delayed lint errors
aren't really related to HIR analysis. They were in there just because
HIR analysis follows AST lowering.

This means `rustc_hir_analysis` and `rustc_lint` can both start
compiling as soon as `rustc_trait_selection` finishes. This also changes
the error order in one test, which doesn't matter.

The commit also changes `emit_delayed_lint` to `emit_delayed_lints`,
factoring out some code duplicated in rustdoc.
2026-03-26 14:31:43 +11:00
Shoyu Vanilla d5bbeb978e Revert "Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr"
This reverts commit 75b9d89c68, reversing
changes made to 7bee525095.
2026-03-24 22:31:37 +09:00
Zalathar de15ab0065 Store value/side-effect index lists inside CacheEncoder
These lists can be considered part of the encoder state, and bundling them
inside the encoder is certainly more convenient than passing them around
separately.
2026-03-24 12:56:49 +11:00
bors bbe8536158 Auto merge of #154217 - RalfJung:miri, r=RalfJung
miri subtree update

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

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

r? @ghost
2026-03-23 04:12:57 +00:00
Ralf Jung b584d4d668 update lockfile 2026-03-22 17:17:56 +01:00
randomicon00 b4f2c8a08e docs: parse unstable options with syn 2026-03-21 12:06:21 -04:00
Ada Bohm bef4b476c1 Updates derive_where and removes workaround 2026-03-19 09:22:03 +01:00
Stuart Cook bbd1428a15 Rollup merge of #153922 - jyn514:jyn/crate-graph, r=jdonszelmann
rustc_mir_build only depends on rustc_lint_defs, not rustc_lint

This speeds up incremental compile times when modifying rustc_lint.
2026-03-16 15:01:35 +11:00
bors a0e206b566 Auto merge of #153799 - notriddle:stringdex-0.0.6, r=GuillaumeGomez
rustdoc-search: update to stringdex 0.0.6

This update includes a few optimizations that reduce the size and index building time:

- the wire format uses two bits to store four possibilities, instead of only handling three https://gitlab.com/notriddle/stringdex/-/merge_requests/34

- the hashes themselves are 40 bits instead of 48, and inlining is able to still fit enough data by storing runs https://gitlab.com/notriddle/stringdex/-/merge_requests/35

- scanning for duplicates takes advantage of the rarity of conflicts, using an array with 32 bit numbers and only pulling in the other 8 bits when actually needed https://gitlab.com/notriddle/stringdex/-/merge_requests/37
2026-03-13 23:18:20 +00:00
Jynn Nelson 7e72e74ea6 mir_build only depends on lint_defs, not lints
This speeds up incremental compile times when modifying rustc_lint.
2026-03-13 20:54:51 +01:00
John Kåre Alsaker 85967c4de4 Add a TaggedQueryKey to identify a query instance 2026-03-13 07:49:38 +01:00
Michael Howell 949570f801 rustdoc-search: update to stringdex 0.0.6
This update includes a few optimizations that reduce the size and
index building time:

- the wire format uses two bits to store four possibilities, instead of
  only handling three
  https://gitlab.com/notriddle/stringdex/-/merge_requests/34

- the hashes themselves are 40 bits instead of 48, and inlining is able
  to still fit enough data by storing runs
  https://gitlab.com/notriddle/stringdex/-/merge_requests/35

- scanning for duplicates takes advantage of the rarity of conflicts,
  using an array with 32 bit numbers and only pulling in the other 8
  bits when actually needed
  https://gitlab.com/notriddle/stringdex/-/merge_requests/37
2026-03-12 19:01:39 -07:00
Jonathan Brouwer cf951bae87 Rollup merge of #153283 - LukeMathWalker:add-rkyv-support, r=aDotInTheVoid
feat(rustdoc-json): Add optional support for rkyv (de)serialization

## Motivation

The JSON documents produced by `rustdoc-json` are _big_. More often than not, tools need to access a small fraction of that output—e.g. a couple of types from a transitive dependency, or a subset of the fields on a given `rustdoc-json-types` type.

Using a binary (de)serialization format and a cache helps to drive down the performance cost of deserialization: you invoke `rustdoc-json` to get the JSON output you need, re-serialize it using a more perfomant format as target (e.g. `bincode` or `postcard`) and thus amortize the cost of future queries that hit the persistent cache rather than `rustdoc-json`.
This is _better_, but still not great: the deserialization cost for crates like `std` still shows up prominently in flamegraphs.

## An Alternative Approach: rkyv

`rkyv` provides a different opportunity: you avoid paying the deserialization cost _upfront_ thanks to [zero-copy deserialization](https://rkyv.org/zero-copy-deserialization.html).
You're often able to determine if you need a certain entry from the JSON document using the archived version of that type, thus incurring the full deserialization cost only for the subset of items you actually need ([example](https://github.com/LukeMathWalker/pavex/pull/574/changes/d067e7e0cfa38da5b0a3c8713b1c53beb0b29a5d)).

## The Change

This PR adds support for `rkyv` behind a feature flag (`rkyv_0_8`).
For most types, it's a straight-forward `derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)` annotation. For co-recursive types, we need to adjust the generated bounds, using the techniques from [`rkyv`'s JSON example](https://github.com/rkyv/rkyv/blob/985b0230a0b9cb9fce4a4ee9facb6af148e27c8e/rkyv/examples/json_like_schema.rs).

I have added new round-trip tests to ensure `rkyv` works as expected.

r? @aDotInTheVoid
2026-03-10 22:44:05 +01:00
Guillaume Gomez 28131e1b8f Update sysinfo version to 0.38.4 2026-03-09 17:27:17 +01:00
Luca Palmieri 1d81c5021a feat(rustdoc-json): Add optional support for rkyv (de)serialization 2026-03-09 15:30:07 +01:00