Commit Graph

3720 Commits

Author SHA1 Message Date
Jonathan Brouwer f84347a07e Rollup merge of #156791 - obi1kenobi:unsafe-kept-in-help-text, r=JonathanBrouwer,Kivooeo
Unsafe kept in help text

Currently when encountering a malformed attribute, the compiler will suggest removing unsafe in the well-formed template even when unsafe is required. This PR preserves whatever unsafe (or lack) exists in the user's code.

r? @jdonszelmann
2026-05-21 12:21:46 +02:00
Aria Givens 970cb15506 Use ast node instead of boolean 2026-05-21 10:54:10 +02:00
Guillaume Gomez 521b89a823 Update sysinfo version to 0.39.2 2026-05-17 02:50:46 +02:00
Philipp Krones 4e3fe3ed28 Update Cargo.lock 2026-05-13 19:53:10 +02:00
Jonathan Brouwer c978cbebea Rollup merge of #156524 - Zalathar:no-pre-codegen, r=oli-obk
Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead

- Alternative to https://github.com/rust-lang/rust/pull/156358.

The `PreCodegen` pass doesn't do anything on its own; it was only serving as a marker to allow `-Zdump-mir` and mir-opt tests to easily dump the final MIR just before codegen.

However, https://github.com/rust-lang/rust/pull/156358#issuecomment-4422445297 pointed out that the `runtime-optimized` phase transition should dump the same MIR, so there shouldn't be any need for a separate *PreCodegen* pass.

---
r? oli-obk (or compiler)
2026-05-13 11:46:40 +02:00
Jonathan Brouwer 91b85f6119 Rollup merge of #156513 - RalfJung:miri, r=RalfJung
miri subtree update

Unblocks https://github.com/rust-lang/rust/pull/156493.

---

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

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

r? @ghost
2026-05-13 11:46:39 +02:00
Zalathar ccb9305e20 Move emit_mir out of rustc_mir_transform::dump_mir
This function doesn't have an obvious home, but there's little reason for it to
be in mir-transform, and having it in `rustc_driver_impl::pretty` at least puts
it near other callers of `write_mir_pretty`.
2026-05-13 14:54:31 +10:00
Ralf Jung d2803c5776 update lockfile and proc_macro_deps 2026-05-12 22:45:14 +02:00
Jonathan Brouwer 05addd9af7 Rollup merge of #156282 - GuillaumeGomez:update-sysinfo, r=Mark-Simulacrum
Update `sysinfo` version to `0.39.0`

Bugfixes, new API and performance improvement. Full changelog is [here](https://github.com/GuillaumeGomez/sysinfo/blob/main/CHANGELOG.md).
2026-05-11 10:29:18 +02:00
Jonathan Brouwer f57cc28c76 Rollup merge of #156147 - Manishearth:icu4xup, r=Mark-Simulacrum
Update ICU4X to 2.2

Needs a data regen.
2026-05-11 10:29:15 +02:00
Guillaume Gomez 4a8c8a8041 Update sysinfo version to 0.39.0 2026-05-07 16:35:50 +02:00
Jonathan Brouwer a48901b65b Rollup merge of #156245 - bjorn3:move_invocation_temp, r=oli-obk
Move invocation_temp into OutputFilenames

While it was previously defined in Session, it is only ever used with OutputFilenames methods.
2026-05-07 14:13:54 +02:00
bjorn3 9297586cb9 Move invocation_temp into OutputFilenames
While it was previously defined in Session, it is only ever used with
OutputFilenames methods.
2026-05-06 15:01:54 +00:00
Jonathan Brouwer c2a463a5d0 Rollup merge of #156127 - GuillaumeGomez:update-askama, r=Urgau
Update `askama` version to `0.16.0`

New features and bugfixes. Full changelog is [here](https://github.com/askama-rs/askama/releases/tag/v0.16.0).

r? @Urgau
2026-05-05 14:25:26 +02:00
Guillaume Gomez 45b9459637 Update askama version to 0.16.0 in clippy 2026-05-04 23:37:54 +02:00
Manish Goregaokar e9c05ff631 Update ICU4X to 2.2 2026-05-04 16:28:58 +00:00
Guillaume Gomez 89005b2ad6 Update askama version to 0.16.0 2026-05-04 03:54:59 +02:00
Edvin Bryntesson 76fd1b3df3 make tools on AttributeParser hold reference to RegisteredTools 2026-05-02 16:02:34 +02:00
Nicholas Nethercote 339797e8b6 Eliminate rustc_lint_defs' dependency on rustc_ast.
It currently only depends on two things:
- `rustc_ast::AttrId`: this is just a re-export of `rustc_span::AttrId`,
  so we can import the original instead.
- `rustc_ast::AttributeExt`: needed only for the `name` and `id`
  methods. We can instead pass in the `name` and `id` directly.
2026-05-01 10:58:42 +10:00
Nicholas Nethercote 9454be304f Invert dependency between rustc_error_messages and rustc_ast*.
`rustc_error_messages` currently depends on
`rustc_ast`/`rustc_ast_pretty`. This is odd, because
`rustc_error_messages` feels like a very low-level module but
`rustc_ast`/`rustc_ast_pretty` do not.

The reason is that a few AST types impl `IntoDiagArg` via
pretty-printing. `rustc_error_messages` can define `IntoDiagArg` and
then impl it for the AST types. But if we invert the dependency we hit
a problem with the orphan rule: `rustc_ast` must impl `IntoDiagArg`
for the AST types, but that requires calling pretty-printing code which
is in `rustc_ast_pretty`, a downstream crate.

This commit avoids this problem by just removing the `IntoDiagArg` impls
for these AST types. There aren't that many of them, and we can just use
`String` in the relevant error structs and use the pretty printer in the
downstream crates that construct the error structs. There are plenty of
existing examples where `String` is used in error structs.

There is now no dependency between `rustc_ast*` and
`rustc_error_messages`.
2026-05-01 10:58:14 +10:00
Rudi Heitbaum be932719fd bump curl-sys and openssl-sys to support OpenSSL 4.0.x
The previously pinned versions of openssl-sys and curl-sys are not
compatible with OpenSSL 4.0.x.

- `curl-sys`: 0.4.84+curl-8.17.0 -> 0.4.87+curl-8.19.0
- `openssl-sys`: 0.9.111 -> 0.9.114
2026-04-24 01:08:58 +00:00
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