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
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.
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.
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
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
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
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
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)
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.
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
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.
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.
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
`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.
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.
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