Commit graph

317453 commits

Author SHA1 Message Date
Nicholas Nethercote
e35fd451a0 Add a useful comment about the RawList stable hash cache.
I tried removing it to see what happened. Not a good idea!
2026-02-06 09:18:19 +11:00
Nicholas Nethercote
09eb497396 Remove Resolver::create_stable_hashing_context.
It only has two uses. We can instead use `with_stable_hashing_context`,
which has more than 30 uses.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
93a1a8064d Move some impls.
`HashStableContext` impls should be in `hcx.rs`, and `HashStable` impls
should be in `impls_syntax.rs`. This commit moves a few that are in the
wrong file.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
f729340aab Inline and remove two StableHashingContext methods.
They both have a single use.

Also adjust a couple of visibilities.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
99b9f51725 Merge two fields in StableHashingContext.
The new type makes the behaviour clearer: we start with the cache in an
"unused" form and then instantiate it once it is actually used.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
7298e17366 Remove rustc_hir::HashStableContext::hash_attr_id.
It has a single impl, which does nothing, as you'd expect when hashing a
type called `HashIgnoredAttrId`!

So this commit just removes it, and `HashIgnoredAttrId::hash_stable`
ends up doing nothing (with a comment) instead of calling the trait
method to do nothing.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
e2edce0221 Remove rustc_span::HashStableContext::hash_spans.
It reads the `HashingControls::span` field, but there is also the
`hashing_controls` method. No need to have two different ways of doing
it.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
cd3c9329fb Fix control flow in assert_default_hashing_controls.
Calling `match` on a struct is a really weird thing to do. As the name
suggests, it's an assert, so let's write it as one. Also clarify the
comment a little.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
c9f827754a Make HashingControls impl Copy.
It has a single `bool` field.
2026-02-06 09:18:18 +11:00
Nicholas Nethercote
c32c48114a Improve is_ignored_attr.
It has a single use. It doesn't need to be public. It doesn't use `self`
and so doesn't need to be in the trait. And `IGNORED_ATTRIBUTES` can be
moved within it.
2026-02-06 09:18:16 +11:00
bors
f889772d65 Auto merge of #152096 - bjorn3:mir_encoding_cleanups, r=oli-obk
Couple of cleanups and optimizations around MIR encoding
2026-02-05 15:30:48 +00:00
bors
66daca1a85 Auto merge of #152163 - JonathanBrouwer:rollup-Ypg7w4H, r=JonathanBrouwer
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#150831 (c-variadic: make `va_arg` match on `Arch` exhaustive)
 - rust-lang/rust#152113 (Fix GitHub CI summary in CodeBuild)
 - rust-lang/rust#152153 (Incorporate query description functions into `QueryVTable`)
 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - rust-lang/rust#152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - rust-lang/rust#152109 (Convert to inline diagnostics in `rustc_errors`)
 - rust-lang/rust#152119 (Convert to inline diagnostics in `rustc_middle`)
 - rust-lang/rust#152121 (Convert to inline diagnostics in `rustc_builtin_macros`)
 - rust-lang/rust#152133 (library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`)

Failed merges:

 - rust-lang/rust#152107 (Convert to inline diagnostics in `rustc_borrowck`)
 - rust-lang/rust#152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - rust-lang/rust#152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - rust-lang/rust#152131 (Port rustc_no_implicit_bounds attribute to parser.)
2026-02-05 12:10:17 +00:00
Jonathan Brouwer
cb77fcb3a6
Rollup merge of #152133 - Enselic:on-broken-pipe-flag-rename, r=ChrisDenton
library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`

This commit is a pure internal rename and does not change any functionality.

The `FLAG_` part of `ON_BROKEN_PIPE_FLAG_USED` comes from that the compiler flag `-Zon-broken-pipe=...` is used to enable the feature.

Remove the `FLAG_` part so the name works both for the current compiler flag `-Zon-broken-pipe=...` and for the upcoming [Externally Implementable Item `#[std::io::on_broken_pipe]`](https://github.com/rust-lang/rust/pull/150591) PR. This makes the diff of that PR smaller.

The local variable name `sigpipe_attr_specified` comes from way back when the feature was controlled with an `fn main()` attribute called `#[unix_sigpipe = "..."]`. Rename that too.
2026-02-05 12:17:03 +01:00
Jonathan Brouwer
3c61714cc3
Rollup merge of #152121 - JonathanBrouwer:convert_builtin_macros, r=lqd
Convert to inline diagnostics in `rustc_builtin_macros`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 12:17:01 +01:00
Jonathan Brouwer
4d535f5642
Rollup merge of #152119 - JonathanBrouwer:convert_middle, r=jdonszelmann
Convert to inline diagnostics in `rustc_middle`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 12:17:01 +01:00
Jonathan Brouwer
62de21f0ad
Rollup merge of #152109 - JonathanBrouwer:convert_errors, r=lqd
Convert to inline diagnostics in `rustc_errors`

For rust-lang/rust#151366
r? @jdonszelmann
2026-02-05 12:17:00 +01:00
Jonathan Brouwer
3421938bb8
Rollup merge of #152106 - JonathanBrouwer:convert_ast_passes, r=jdonszelmann
Convert to inline diagnostics in `rustc_ast_passes`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 12:16:59 +01:00
Jonathan Brouwer
85bc524fc4
Rollup merge of #152070 - JonathanBrouwer:convert_pattern_analysis, r=jdonszelmann
Convert to inline diagnostics in `rustc_pattern_analysis`

For https://github.com/rust-lang/rust/issues/151366

r? @jdonszelmann
2026-02-05 12:16:58 +01:00
Jonathan Brouwer
ce3df42e35
Rollup merge of #152153 - Zalathar:descs, r=nnethercote
Incorporate query description functions into `QueryVTable`

Putting a `desc` function in each query vtable reduces the amount of parameter juggling required when creating query stack frames, because almost all of the necessary information can be found in the vtable.

There should be no change to compiler output.
2026-02-05 12:16:58 +01:00
Jonathan Brouwer
de3e69ce1a
Rollup merge of #152113 - Kobzol:fix-codebuild-summary, r=marcoieni
Fix GitHub CI summary in CodeBuild

We need to copy the summary only after the data is copied out from the Docker image in Docker-in-Docker/CodeBuild scenarios. This was broken for many months now.

Compare the summary https://github.com/rust-lang/rust/actions/runs/21663321354 (before) and https://github.com/rust-lang/rust/actions/runs/21671277310 (after) - the dist-x86_64-linux job now correctly contains the summary generated by `opt-dist`.

r? @marcoieni
2026-02-05 12:16:57 +01:00
Jonathan Brouwer
82b5849618
Rollup merge of #150831 - folkertdev:more-va-arg-2, r=workingjubilee
c-variadic: make `va_arg` match on `Arch` exhaustive

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

Continuing from https://github.com/rust-lang/rust/pull/150094, the more annoying cases remain. These are mostly very niche targets without Clang `va_arg` implementations, and so it might just be easier to defer to LLVM instead of us getting the ABI subtly wrong. That does mean we cannot stabilize c-variadic on those targets I think.

Alternatively we could ask target maintainers to contribute an implementation. I'd honestly prefer they make that change to LVM though (likely by just using `CodeGen::emitVoidPtrVAArg`) that we can mirror.

r? @workingjubilee
2026-02-05 12:16:56 +01:00
Jonathan Brouwer
e55eb45661
Convert to inline diagnostics in rustc_errors 2026-02-05 12:14:48 +01:00
Jonathan Brouwer
67c6cd99b7
Convert to inline diagnostics in rustc_pattern_analysis 2026-02-05 12:13:25 +01:00
Jonathan Brouwer
0da9476010
Convert to inline diagnostics in rustc_ast_passes 2026-02-05 12:08:42 +01:00
Jonathan Brouwer
46753b1b43
Convert to inline diagnostics in rustc_middle 2026-02-05 12:02:02 +01:00
Jonathan Brouwer
d40e60fc44
Convert to inline diagnostics in rustc_builtin_macros 2026-02-05 12:00:56 +01:00
Zalathar
438220673f Incorporate query description functions into QueryVTable 2026-02-05 18:41:34 +11:00
bors
0a13b43612 Auto merge of #152156 - JonathanBrouwer:rollup-hT8ON1e, r=JonathanBrouwer
Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#150379 (Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`)
 - rust-lang/rust#152033 (Rename trait `DepNodeParams` to `DepNodeKey`)
 - rust-lang/rust#152142 (Convert to inline diagnostics in `rustc_hir_typeck`)
 - rust-lang/rust#152145 (Disable flaky test `oneshot::recv_timeout_before_send`)
 - rust-lang/rust#152020 (Remove dummy loads on offload codegen)
 - rust-lang/rust#152023 (Some `rustc_query_system` cleanups)
 - rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
 - rust-lang/rust#152081 (Port depgraph testing attributes to parser)
 - rust-lang/rust#152090 (Port reexport_test_harness_main to attr parser)
 - rust-lang/rust#152105 (Convert to inline diagnostics in `rustc_ast_lowering`)
 - rust-lang/rust#152108 (Convert to inline diagnostics in `rustc_expand`)
 - rust-lang/rust#152110 (Fix incorrect RSS on systems with non-4K page size)
 - rust-lang/rust#152111 (bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default)
 - rust-lang/rust#152114 (Convert to inline diagnostics in `rustc_mir_transform`)
 - rust-lang/rust#152115 (Convert to inline diagnostics in `rustc_metadata`)
 - rust-lang/rust#152116 (Remove rustdoc GUI flaky test)
 - rust-lang/rust#152118 (Convert to inline diagnostics in `rustc_codegen_ssa`)
 - rust-lang/rust#152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD)

Failed merges:

 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
 - rust-lang/rust#152106 (Convert to inline diagnostics in `rustc_ast_passes`)
 - rust-lang/rust#152109 (Convert to inline diagnostics in `rustc_errors`)
 - rust-lang/rust#152117 (Convert to inline diagnostics in `rustc_trait_selection`)
 - rust-lang/rust#152119 (Convert to inline diagnostics in `rustc_middle`)
 - rust-lang/rust#152126 (Convert to inline diagnostics in `rustc_mir_build`)
 - rust-lang/rust#152131 (Port rustc_no_implicit_bounds attribute to parser.)
2026-02-05 07:36:53 +00:00
Jonathan Brouwer
f163864627
Rollup merge of #152128 - zmodem:matches-logical-or-141497, r=nikic
Adopt matches-logical-or-141497.rs to LLVM HEAD

After http://github.com/llvm/llvm-project/pull/178977, the and + icmp are folded to trunc.
2026-02-05 08:32:57 +01:00
Jonathan Brouwer
dd05e03db1
Rollup merge of #152118 - JonathanBrouwer:convert_codegen_ssa, r=jdonszelmann
Convert to inline diagnostics in `rustc_codegen_ssa`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 08:32:56 +01:00
Jonathan Brouwer
b1a29271e9
Rollup merge of #152116 - GuillaumeGomez:fix-rustdoc-gui-flaky, r=GuillaumeGomez
Remove rustdoc GUI flaky test

Part of rust-lang/rust#93784.

Originally, this test was checking more things (original version is [here](6bbbff5189)), now it only checks that the `searchIndex` variable is global. However, we already are forced to check it in the `rustddoc-js[-std]` testsuites so I think it's safe to say that it's superfluous and definitely not worth all the CI flakyness it created.

r? ghost
2026-02-05 08:32:55 +01:00
Jonathan Brouwer
9a2c4cb064
Rollup merge of #152115 - GuillaumeGomez:inline-diag-rustc_metadata, r=JonathanBrouwer
Convert to inline diagnostics in `rustc_metadata`

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

r? @JonathanBrouwer
2026-02-05 08:32:55 +01:00
Jonathan Brouwer
c2da69cd18
Rollup merge of #152114 - JonathanBrouwer:convert_mir_transform, r=jdonszelmann
Convert to inline diagnostics in `rustc_mir_transform`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 08:32:54 +01:00
Jonathan Brouwer
e7518ac7e0
Rollup merge of #152111 - androm3da:bcain/qurt_unwind, r=jieyouxu
bootstrap: exclude hexagon-unknown-qurt from llvm-libunwind default

Hexagon Linux targets (hexagon-unknown-linux-musl) use in-tree llvm-libunwind for stack unwinding. However, hexagon-unknown-qurt uses libc_eh from the Hexagon SDK instead.
2026-02-05 08:32:53 +01:00
Jonathan Brouwer
e4a7eb7874
Rollup merge of #152110 - heiher:fix-rss, r=jieyouxu
Fix incorrect RSS on systems with non-4K page size

`get_resident_set_size` computed RSS by multiplying the number of pages from `/proc/self/statm` with a hard-coded 4096-byte page size. This produces incorrect results on systems where the runtime page size is not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime so the RSS reported in `-Z time-passes` output is accurate across platforms.
2026-02-05 08:32:53 +01:00
Jonathan Brouwer
d58a87b287
Rollup merge of #152108 - JonathanBrouwer:convert_expand, r=jdonszelmann
Convert to inline diagnostics in `rustc_expand`

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
2026-02-05 08:32:52 +01:00
Jonathan Brouwer
945bfa770e
Rollup merge of #152105 - GuillaumeGomez:inline-diag-rustc_ast_lowering, r=JonathanBrouwer
Convert to inline diagnostics in `rustc_ast_lowering`

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

r? @JonathanBrouwer
2026-02-05 08:32:51 +01:00
Jonathan Brouwer
011d7b0525
Rollup merge of #152090 - Ozzy1423:attrs5, r=JonathanBrouwer
Port reexport_test_harness_main to attr parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

I don't think I can use the parsed form in compiler/rustc_builtin_macros/src/test_harness.rs since that has to use the AST attrs?

r? @JonathanBrouwer
2026-02-05 08:32:50 +01:00
Jonathan Brouwer
f5a90728e3
Rollup merge of #152081 - clubby789:port-depgraph-attrs, r=JonathanBrouwer
Port depgraph testing attributes to parser

Tracking issue: rust-lang/rust#131229

Ports `#[rustc_clean]`, `#[rustc_if_this_changed]` and `#[rustc_then_this_would_need]` attributes.

Removes references to `rustc_dirty` as that attribute was folded into `rustc_clean` some time ago and rename some code accordingly.

r? JonathanBrouwer
2026-02-05 08:32:50 +01:00
Jonathan Brouwer
50c768e1bb
Rollup merge of #152068 - JonathanBrouwer:convert_resolve, r=lqd
Convert to inline diagnostics in `rustc_resolve`

For https://github.com/rust-lang/rust/issues/151366
2026-02-05 08:32:47 +01:00
Jonathan Brouwer
cf2ea13042
Rollup merge of #152023 - nnethercote:rm-Value, r=nnethercote
Some `rustc_query_system` cleanups

Small improvements I found while looking closely at `rustc_query_system`. Best reviewed one commit at a time.

r? @cjgillot
2026-02-05 08:32:46 +01:00
Jonathan Brouwer
b66ead827c
Rollup merge of #152020 - Sa4dUs:offload-remove-dummy-loads, r=ZuseZ4
Remove dummy loads on offload codegen

The current logic generates two dummy loads to prevent some globals from being optimized away. This blocks memtransfer loop hoisting optimizations, so it's time to remove them.

r? @ZuseZ4
2026-02-05 08:32:45 +01:00
Jonathan Brouwer
b0e1a382eb
Rollup merge of #152145 - Zalathar:recv-timeout-before-send, r=workingjubilee
Disable flaky test `oneshot::recv_timeout_before_send`

This test is inherently flaky due to a thread-scheduling race condition, and has failed several times in CI, e.g.:
- https://github.com/rust-lang/rust/pull/151739#issuecomment-3850533911
- https://github.com/rust-lang/rust/pull/151971#issuecomment-3832862029
- https://github.com/rust-lang/rust/pull/151376#issuecomment-3774862894

---
- cc @connortsui20, author of https://github.com/rust-lang/rust/pull/143741
2026-02-05 08:32:45 +01:00
Jonathan Brouwer
775ae61f3e
Rollup merge of #152142 - JonathanBrouwer:convert_hir_typeck, r=GuillaumeGomez
Convert to inline diagnostics in `rustc_hir_typeck`

For https://github.com/rust-lang/rust/issues/151366
r? @GuillaumeGomez
2026-02-05 08:32:44 +01:00
Jonathan Brouwer
c5381dd987
Rollup merge of #152033 - Zalathar:dep-node-key, r=nnethercote
Rename trait `DepNodeParams` to `DepNodeKey`

In query system plumbing, we usually refer to a query's explicit argument value as a “key”.

The first few commits do some preliminary cleanup that would conflict with the rename; the rename itself is in the final commit.

r? nnethercote (or compiler)
2026-02-05 08:32:44 +01:00
Jonathan Brouwer
c0b4db118b
Rollup merge of #150379 - ChrisDenton:exitcode, r=jieyouxu
Return `ExitCode` from `rustc_driver::main` instead of calling `process::exit`

This makes rustc simply return an exit code from main rather than calling `std::process::exit` with an exit code. This means that drops run normally and the process exits cleanly. This is similar to what happens when an ICE occurs (due to being a panic that's caught by std's `lang_start`).

Also instead of hard coding success and failure codes this uses `ExitCode::SUCCESS` and `ExitCode::FAILURE`, which in turn effectively uses `libc::EXIT_SUCCESS` and `libc::EXIT_FAILURE` (via std). These are `0` and `1` respectively for all currently supported host platforms so it doesn't actually change the exit code.
2026-02-05 08:32:43 +01:00
bors
9f4b56a5ae Auto merge of #151739 - Zalathar:short-backtrace, r=fee1-dead
Use fewer intermediate functions for short backtraces in queries

If we make sure that `compute_fn` in the query's vtable is actually named `__rust_begin_short_backtrace`, we can avoid the need for some additional intermediate functions and stack frames.

This is similar to how the `get_query_incr` and `get_query_non_incr` functions are actually named `__rust_end_short_backtrace`.

---

Before/after comparison: https://github.com/rust-lang/rust/pull/151739#issuecomment-3815432527

---

- Earlier draft of this PR: https://github.com/rust-lang/rust/pull/151719
- Introduction of this backtrace-trimming: https://github.com/rust-lang/rust/pull/108938
2026-02-05 01:56:57 +00:00
Zalathar
6970849fee Disable flaky test oneshot::recv_timeout_before_send 2026-02-05 12:38:23 +11:00
Folkert de Vries
d2b5ba2ff7
c-variadic: make va_arg match on Arch exhaustive 2026-02-05 00:41:10 +01:00
Folkert de Vries
aa0ce237b4
c-variadic: minor cleanups of va_arg 2026-02-05 00:38:08 +01:00