Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Aug 29, 2025

Oneirical and others added 12 commits August 27, 2025 00:23
Running `./x --verbose` will still print out the command-line arguments, and
setting `RUST_LOG=compiletest` will now log the full config instead of a
subset.
When working on a new output-capture system, this will make it easier to obtain
a capturing stream from the test context.
The code in this module is always called in the context of running an
individual tests, and sometimes prints output that needs to be captured.

Moving this module into `runtest` will make it easier to find and audit all of
the print statements that need to be updated when overhauling output-capture.
This appears to have been leftover debugging code.

If the capture information turns out to have still been useful, we can find a
way to emit it in a way that doesn't interfere with overhauling compiletests's
output capture system.
They're now just an `Arc<Vec<TokenTree>>`. No ropes, no views, nothing
like that.
I.e. the type definition, then a single inherent `impl` block, then the
trait `impl` blocks.

The lack of sensible ordering here has bugged me for some time.
…=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch rust-lang#2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
…=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang#2 of Batch rust-lang#2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
compiletest: Reduce the number of `println!` calls that don't have access to `TestCx`

In order to stop using `#![feature(internal_output_capture)]` in compiletest, we need to be able to capture the console output of individual tests run by the executor.

The approach I have planned is to have all test runners print “console” output into a trait object that is passed around as part of `TestCx`, since almost all test-runner code has easy access to that context. So `println!("foo")` will become `writeln!(self.stdout, "foo")`, and so on.

In order to make that viable, we need to avoid unnecessary printing in places that don't have easy access to `TestCx`. To do so, we can either get rid of unnecessary print statements, or rearrange the code to make the context available. This PR uses both approaches.

r? jieyouxu
…r=chenyukang

`TokenStream` cleanups

r? `@chenyukang`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 29, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

📌 Commit 197cb26 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2025
@bors
Copy link
Collaborator

bors commented Aug 29, 2025

⌛ Testing commit 197cb26 with merge c077761...

bors added a commit that referenced this pull request Aug 29, 2025
Rollup of 4 pull requests

Successful merges:

 - #145675 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch #2])
 - #145676 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2])
 - #145982 (compiletest: Reduce the number of `println!` calls that don't have access to `TestCx`)
 - #145984 (`TokenStream` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-msvc-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

error: test failed, to rerun pass `-p std --lib`
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 1:22:40
make: *** [Makefile:112: ci-msvc-py] Error 1
  local time: Fri Aug 29 12:36:48 CUT 2025
  network time: Fri, 29 Aug 2025 12:36:49 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 29, 2025
@matthiaskrgr
Copy link
Member Author

@bors retry

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 29, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 29, 2025
@matthiaskrgr matthiaskrgr added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Aug 29, 2025
@bors
Copy link
Collaborator

bors commented Aug 29, 2025

⌛ Testing commit 197cb26 with merge fe55364...

@bors
Copy link
Collaborator

bors commented Aug 29, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing fe55364 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 29, 2025
@bors bors merged commit fe55364 into rust-lang:master Aug 29, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 29, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#145675 Rehome 30 tests/ui/issues/ tests to other subdirectories … a2e99176c481df2f0135965e14714215561b5450 (link)
#145676 Rehome 30 tests/ui/issues/ tests to other subdirectories … 1297094e5b9dc48a5dcbd52c87bede17e924ebcc (link)
#145982 compiletest: Reduce the number of println! calls that don… 3df64830a7058c73130c75e12f873a2d0fe0dafa (link)
#145984 TokenStream cleanups 315f2e866c613da164977c4b74f6b5db5c33832a (link)

previous master: db3fd4708c

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing db3fd47 (parent) -> fe55364 (this PR)

Test differences

Show 242 test diffs

Stage 1

  • [ui] tests/ui/array-slice-vec/pattern-matching-fixed-length-vectors-7784.rs: pass -> [missing] (J1)
  • [ui] tests/ui/array-slice-vec/vector-slice-matching-8498.rs: [missing] -> pass (J1)
  • [ui] tests/ui/binding/ref-pattern-drop-behavior-8860.rs: [missing] -> pass (J1)
  • [ui] tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs: [missing] -> pass (J1)
  • [ui] tests/ui/borrowck/incorrect-loan-error-on-local-update-5550.rs: [missing] -> pass (J1)
  • [ui] tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs: [missing] -> pass (J1)
  • [ui] tests/ui/cast/associated-type-bounds-cast-54094.rs: [missing] -> pass (J1)
  • [ui] tests/ui/cast/owned-struct-to-trait-cast-6318.rs: [missing] -> pass (J1)
  • [ui] tests/ui/collections/vecdeque-append-operation-54477.rs: [missing] -> pass (J1)
  • [ui] tests/ui/function-pointer/function-pointer-comparison-54696.rs: [missing] -> pass (J1)
  • [ui] tests/ui/issues/issue-53419.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-53568.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5358-1.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5439.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-54462-mutable-noalias-correctness.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5666.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5708.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5718.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5883.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5884.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-5900.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-6117.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-6344-let.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-7092.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-7178.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-7364.rs: pass -> [missing] (J1)
  • [ui] tests/ui/loops/unreachable-while-loop-5741.rs: [missing] -> pass (J1)
  • [ui] tests/ui/match/mismatched-types-in-match-5358.rs: [missing] -> pass (J1)
  • [ui] tests/ui/match/mismatched-types-in-match-7867.rs: [missing] -> pass (J1)
  • [ui] tests/ui/match/mismatched-types-in-match-pattern-7867.rs: pass -> [missing] (J1)
  • [ui] tests/ui/methods/trait-method-self-param-error-7575.rs: pass -> [missing] (J1)
  • [ui] tests/ui/numeric/type-limit-comparisons-6130.rs: [missing] -> pass (J1)
  • [ui] tests/ui/pattern/ref-in-function-parameter-patterns-8860.rs: pass -> [missing] (J1)
  • [ui] tests/ui/repr/packed-struct-with-enum-53728.rs: [missing] -> pass (J1)
  • [ui] tests/ui/resolve/unit-like-struct-masks-constant-7044.rs: [missing] -> pass (J1)
  • [ui] tests/ui/static/global-variable-promotion-error-7364.rs: [missing] -> pass (J1)
  • [ui] tests/ui/structs/destructuring-struct-with-dtor-6344.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/trait-implementation-and-usage-7563.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/trait-implementation-generic-access-6898.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/trait-object-lifetime-bounds-7563.rs: [missing] -> pass (J1)
  • [ui] tests/ui/unreachable-code/boolean-negation-in-unreachable-code-7344.rs: [missing] -> pass (J1)
  • [ui] tests/ui/unsafe/extern-function-requires-unsafe-5844.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/array-slice-vec/matching-on-vector-slice-option-8498.rs: pass -> [missing] (J0)
  • [ui] tests/ui/array-slice-vec/vector-slice-matching-8498.rs: [missing] -> pass (J0)
  • [ui] tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs: [missing] -> pass (J0)
  • [ui] tests/ui/binding/ref-pattern-drop-behavior-8860.rs: [missing] -> pass (J0)
  • [ui] tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs: [missing] -> pass (J0)
  • [ui] tests/ui/borrowck/struct-with-reference-to-trait-5708.rs: [missing] -> pass (J0)
  • [ui] tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs: [missing] -> pass (J0)
  • [ui] tests/ui/cast/associated-type-bounds-cast-54094.rs: [missing] -> pass (J0)
  • [ui] tests/ui/cast/owned-struct-to-trait-cast-6318.rs: [missing] -> pass (J0)
  • [ui] tests/ui/codegen/static-array-comparison-7012.rs: [missing] -> pass (J0)
  • [ui] tests/ui/cross-crate/static-regions-in-cross-crate-8259.rs: pass -> [missing] (J0)
  • [ui] tests/ui/cross-crate/static-with-cross-crate-regions-8259.rs: [missing] -> pass (J0)
  • [ui] tests/ui/enum/enum-referred-by-submodule-5900.rs: [missing] -> pass (J0)
  • [ui] tests/ui/enum/match-either-enum-variants-6117.rs: [missing] -> pass (J0)
  • [ui] tests/ui/issues/issue-53419.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-53568.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-53728.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-54094.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5439.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-54477-reduced-2.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-54696.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-55380.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5554.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5666.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5688.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5708.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5883.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5884.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5900.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5917.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5988.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-6117.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-6130.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-6153.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-6557.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-6738.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-7012.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-7044.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-7092.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-7268.rs: pass -> [missing] (J0)
  • [ui] tests/ui/issues/issue-7364.rs: pass -> [missing] (J0)
  • [ui] tests/ui/loops/unreachable-while-loop-5741.rs: [missing] -> pass (J0)
  • [ui] tests/ui/macros/macro-variable-unused-reporting-5718.rs: [missing] -> pass (J0)
  • [ui] tests/ui/match/mismatched-types-in-match-5358.rs: [missing] -> pass (J0)
  • [ui] tests/ui/match/mismatched-types-in-match-pattern-7867.rs: pass -> [missing] (J0)
  • [ui] tests/ui/modules/pub-use-module-alias-5950.rs: [missing] -> pass (J0)
  • [ui] tests/ui/privacy/pub-restricted-path-usage-55376.rs: [missing] -> pass (J0)
  • [ui] tests/ui/resolve/duplicate-name-in-module-6936.rs: [missing] -> pass (J0)
  • [ui] tests/ui/resolve/module-import-resolution-7663.rs: pass -> [missing] (J0)
  • [ui] tests/ui/static/global-variable-promotion-error-7364.rs: [missing] -> pass (J0)
  • [ui] tests/ui/structs/nonexistent-struct-field-error-5439.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/nll-ice-custom-type-ops-53568.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/opaque-trait-size-error-5883.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/self-implements-kinds-in-default-methods-8171.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/trait-implementation-generic-access-6898.rs: [missing] -> pass (J0)
  • [ui] tests/ui/unsafe/extern-function-requires-unsafe-5844.rs: [missing] -> pass (J0)

(and 140 additional test diffs)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard fe55364329579d361b1ab565728bc033a7dba07e --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 8106.1s -> 6732.0s (-17.0%)
  2. dist-ohos-x86_64: 4749.3s -> 4145.2s (-12.7%)
  3. aarch64-apple: 5097.8s -> 5689.5s (11.6%)
  4. dist-arm-linux-musl: 5968.5s -> 5396.2s (-9.6%)
  5. aarch64-msvc-2: 4879.2s -> 5329.2s (9.2%)
  6. dist-aarch64-msvc: 6258.2s -> 5704.1s (-8.9%)
  7. x86_64-msvc-ext2: 6402.1s -> 5856.5s (-8.5%)
  8. dist-ohos-armv7: 4366.9s -> 4001.9s (-8.4%)
  9. dist-aarch64-windows-gnullvm: 5016.3s -> 4638.3s (-7.5%)
  10. pr-check-2: 2242.5s -> 2096.5s (-6.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fe55364): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.612s -> 467.034s (-0.12%)
Artifact size: 388.52 MiB -> 388.52 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants