Commit graph

317420 commits

Author SHA1 Message Date
Jonathan Brouwer
e55eb45661
Convert to inline diagnostics in rustc_errors 2026-02-05 12:14:48 +01: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
Nicholas Nethercote
0420a2e864 Remove Cache::clear.
It's unused. And it's nice to remove this function that didn't behave
like normal `clear` does, as the comment explained.
2026-02-05 09:29:46 +11:00
Nicholas Nethercote
0932068b6c Move the QueryOverflow and QueryOverflowNote errors.
They are defined in `rustc_query_system` but used in `rustc_query_impl`.
This is very much *not* how things are supposed to be done; I suspect
someone got lazy and took a shortcut at some point.

This commit moves the errors into `rustc_query_impl`. This requires more
lines of code to give `rustc_query_impl` an errors module, but it's
worthwhile to do things in the normal way instead of a weird exceptional
way.
2026-02-05 09:29:46 +11:00
Nicholas Nethercote
7bcb7a281e Move rustc_middle::values module to rustc_middle::query::values.
It's a better place for it, because it relates to queries.
2026-02-05 09:29:43 +11:00
Nicholas Nethercote
a68bb0c371 Move rustc_query_system::values module into rustc_middle.
It's a tiny module with one trait and a default impl. It's not used in
`rustc_query_system`; all uses and non-default impls are in
`rustc_middle` and `rustc_query_impl`.

This commit moves it into `rustc_middle`, which makes things simpler
overall.
2026-02-05 08:15:16 +11:00
Jamie Hill-Daniel
522778e348 Move query-dep-graph opt check to attr parsing 2026-02-04 21:00:37 +00:00
Jamie Hill-Daniel
de7067938d Port rustc_if_this_changed/rustc_then_this_would_need to attr parser 2026-02-04 21:00:36 +00:00
Jamie Hill-Daniel
94a0ba50e1 Port rustc_clean to attribute parser
Also remove mentions of removed `rustc_dirty`
2026-02-04 20:58:02 +00:00
Jonathan Brouwer
44a14c1f30
Convert to inline diagnostics in rustc_hir_typeck 2026-02-04 21:36:48 +01:00
Hans Wennborg
23e5b2499f 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-04 19:20:10 +01:00
Guillaume Gomez
534b6c60e0 Convert to inline diagnostics in rustc_metadata 2026-02-04 19:13:49 +01:00
Jonathan Brouwer
e005754c06
Convert to inline diagnostics in rustc_resolve 2026-02-04 18:32:44 +01:00
Jonathan Brouwer
40695f18be
Convert to inline diagnostics in rustc_mir_transform 2026-02-04 18:29:47 +01:00
bors
db3e99bbab Auto merge of #150605 - RalfJung:fallback-intrinsic-skip, r=mati865
skip codegen for intrinsics with big fallback bodies if backend does not need them

This hopefully fixes the perf regression from https://github.com/rust-lang/rust/pull/148478. I only added the intrinsics with big fallback bodies to the list; it doesn't seem worth the effort of going through the entire list.

Fixes https://github.com/rust-lang/rust/issues/149945
Cc @scottmcm @bjorn3
2026-02-04 17:12:58 +00:00
Jonathan Brouwer
d445a2aabb
Convert to inline diagnostics in rustc_codegen_ssa 2026-02-04 17:24:41 +01:00
Guillaume Gomez
607ac4bb84 Remove rustdoc GUI flaky test 2026-02-04 17:09:57 +01:00
WANG Rui
78b55fc337 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-04 23:32:36 +08:00
Brian Cain
caaca04e68 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-04 09:30:56 -06:00
Guillaume Gomez
8d09ba7ae5 Convert to inline diagnostics in rustc_ast_lowering 2026-02-04 16:28:49 +01:00
Jonathan Brouwer
9dab26a9ab
Convert to inline diagnostics in rustc_expand 2026-02-04 16:16:16 +01:00
Marcelo Domínguez
212c8c3811 Remove dummy loads 2026-02-04 15:26:56 +01:00
bors
8bccf1224d Auto merge of #152104 - JonathanBrouwer:rollup-N93TdHm, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150992 (link modifier `export-symbols`: export all global symbols from selected uptream c static libraries)
 - rust-lang/rust#151534 (target: fix destabilising target-spec-json)
 - rust-lang/rust#152088 (rustbook/README.md: add missing `)`)
 - rust-lang/rust#151526 (Fix autodiff codegen tests)
 - rust-lang/rust#151810 (citool: report debuginfo test statistics)
 - rust-lang/rust#151952 (Revert doc attribute parsing errors to future warnings)
 - rust-lang/rust#152065 (Convert to inline diagnostics in `rustc_ty_utils`)
 - rust-lang/rust#152066 (Convert to inline diagnostics in `rustc_session`)
 - rust-lang/rust#152069 (Convert to inline diagnostics in `rustc_privacy`)
 - rust-lang/rust#152072 (Convert to inline diagnostics in `rustc_monomorphize`)
 - rust-lang/rust#152083 (Fix set_times_nofollow for directory on windows)
 - rust-lang/rust#152102 (Convert to inline diagnostics in all codegen backends)

Failed merges:

 - rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
 - rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
2026-02-04 13:54:17 +00:00
Jonathan Brouwer
cf0e19b0b4
Rollup merge of #152102 - bjorn3:inline_fluent_codegen_backends, r=JonathanBrouwer,GuillaumeGomez
Convert to inline diagnostics in all codegen backends

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

r? @JonathanBrouwer
2026-02-04 14:39:29 +01:00
Jonathan Brouwer
3184d55536
Rollup merge of #152083 - chenyukang:yukang-fix-set-times-nofollow-on-windows, r=ChrisDenton
Fix set_times_nofollow for directory on windows

Fix issue from:
https://github.com/rust-lang/rust/issues/147455#issuecomment-3841311858

old code `opts.write(true)` on Windows requests `GENERIC_WRITE` access, replace with `opts.access_mode(c::FILE_WRITE_ATTRIBUTES)` to get minimal permission.

r? @joshtriplett
2026-02-04 14:39:28 +01:00
Jonathan Brouwer
bf838717a4
Rollup merge of #152072 - JonathanBrouwer:convert_monomorphize, r=jdonszelmann
Convert to inline diagnostics in `rustc_monomorphize`

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

r? @jdonszelmann
2026-02-04 14:39:27 +01:00
Jonathan Brouwer
ecafacdeb7
Rollup merge of #152069 - JonathanBrouwer:convert_privacy, r=lqd
Convert to inline diagnostics in `rustc_privacy`

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

r? @jdonszelmann
2026-02-04 14:39:25 +01:00
Jonathan Brouwer
1c142db7d9
Rollup merge of #152066 - JonathanBrouwer:session_convert, r=jdonszelmann
Convert to inline diagnostics in `rustc_session`

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

r? @jdonszelmann
2026-02-04 14:39:24 +01:00
Jonathan Brouwer
8e361cfa69
Rollup merge of #152065 - JonathanBrouwer:convert_ty_utils, r=lqd
Convert to inline diagnostics in `rustc_ty_utils`

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

r? @jdonszelmann
2026-02-04 14:39:23 +01:00
Jonathan Brouwer
76a49eeb6c
Rollup merge of #151952 - GuillaumeGomez:revert-error-to-future-warning, r=JonathanBrouwer
Revert doc attribute parsing errors to future warnings

Part of https://github.com/rust-lang/rust/issues/151865 (hopefully fixes it).

r? @JonathanBrouwer
2026-02-04 14:39:22 +01:00