Skip to content

Use rustc's --diagnostic-width flag in UI tests#3460

Merged
joshlf merged 1 commit into
mainfrom
ksapru-use-diagnostic-flag
Jun 12, 2026
Merged

Use rustc's --diagnostic-width flag in UI tests#3460
joshlf merged 1 commit into
mainfrom
ksapru-use-diagnostic-flag

Conversation

@joshlf

@joshlf joshlf commented Jun 12, 2026

Copy link
Copy Markdown
Member

Pass --diagnostic-width=100 to rustc in UI tests to ensure consistent error message line-wrapping regardless of the terminal width of the environment in which the tests are run.

The flag is skipped for the 'msrv' toolchain (Rust 1.56.0) since it was only stabilized in Rust 1.70.0.

The TERM/COLUMNS environment variables are retained since they can still influence other tools, but a comment is updated to clarify that --diagnostic-width is now the primary and more reliable mechanism.

Fixes #3113

Pass --diagnostic-width=100 to rustc in UI tests to ensure consistent
error message line-wrapping regardless of the terminal width of the
environment in which the tests are run.

The flag is skipped for the 'msrv' toolchain (Rust 1.56.0) since it was
only stabilized in Rust 1.70.0.

The TERM/COLUMNS environment variables are retained since they can still
influence other tools, but a comment is updated to clarify that
--diagnostic-width is now the primary and more reliable mechanism.

Fixes #3113
@joshlf

joshlf commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

This represents #3241 rebased on main since I can't force-push to #3241's upstream.

@joshlf joshlf enabled auto-merge June 12, 2026 12:35
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (c518ab2) to head (bbc5165).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3460   +/-   ##
=======================================
  Coverage   91.85%   91.85%           
=======================================
  Files          20       20           
  Lines        6093     6093           
=======================================
  Hits         5597     5597           
  Misses        496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf

joshlf commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

The flag is skipped for the 'msrv' toolchain (Rust 1.56.0) since it was only stabilized in Rust 1.70.0.

@jswrenn – another reason to bump our MSRV; this will remain unstable because of the MSRV toolchain until we bump to/past 1.70.0.

@joshlf joshlf added this pull request to the merge queue Jun 12, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 12, 2026
@joshlf joshlf merged commit d35c00e into main Jun 12, 2026
131 checks passed
@joshlf joshlf deleted the ksapru-use-diagnostic-flag branch June 12, 2026 20:16
Comment on lines +28 to +29
= note: the full name for the type has been written to '/long-type-HASH.txt'
= note: consider using `--verbose` to print the full type name to the console

@jswrenn jswrenn Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can follow up and set the diagnostic width sufficiently high that truncation does not generally occur?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use rustc's --diagnostic-width flag in UI tests

4 participants