Skip to content

Fix unstable diagnostics in tests#157299

Open
zetanumbers wants to merge 3 commits into
rust-lang:mainfrom
zetanumbers:fix-unstable-diagnostics-in-tests
Open

Fix unstable diagnostics in tests#157299
zetanumbers wants to merge 3 commits into
rust-lang:mainfrom
zetanumbers:fix-unstable-diagnostics-in-tests

Conversation

@zetanumbers
Copy link
Copy Markdown
Contributor

@zetanumbers zetanumbers commented Jun 2, 2026

The main inconsistency in changed tests happens when subdiagnostic pads the main diagnostic with an empty source line (aka "|"). Meanwhile the parallel frontend might bunch subdiagnostics on a single primary diagnostic, removing padding from some other one. So we can just ignore "|" lines.

Updates #154314
Reverts #157103

Inconsistency happens when subdiagnostic pads the main diagnostic with
an empty source line (aka "|"). Meanwhile the parallel frontend might
bunch subdiagnostics on a single primary diagnostic, removing padding
from some other one.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 2, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added the A-compiletest Area: The compiletest test runner label Jun 2, 2026
@rustbot rustbot added 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. labels Jun 2, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 2, 2026

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

//@ edition:2021

//@ check-pass
//@ ignore-parallel-frontend unstable liveness diagnostics
Copy link
Copy Markdown
Contributor

@petrochenkov petrochenkov Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could you keep nicer formatting while doing these changes, like

//@ directives (without empty lines)

#![attributes] (after an empty line)

other code (after an empty line)

(Here and in some other tests.)

View changes since the review

} else if compare_output_by_lines {
let mut actual_lines: Vec<&str> = actual.lines().collect();
let mut expected_lines: Vec<&str> = expected.lines().collect();
// Filter out padded empty code lines
Copy link
Copy Markdown
Contributor

@petrochenkov petrochenkov Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the same filtering required for the compare_output_by_lines_subset scenario above?

View changes since the review

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2026
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 S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants