Repository navigation
fix: match rustc-unicode locations in the rustc problem matcher - #23598
Merged
ChayimFriedman2 merged 1 commit intoNov 6, 2026
Merged
ChayimFriedman2 merged 1 commit into
ChayimFriedman2 merged 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
With `-Zunstable-options --error-format=human-unicode` (cargo's `rustc-unicode`), rustc prints the primary location as `╭▸ src/main.rs:2:5` (or `─▸`/`├▸`) instead of `--> src/main.rs:2:5`. The `$rustc` problem pattern only skipped `-`, `>`, `=` and whitespace before the path, so the box-drawing prefix ended up in the file name and diagnostics could not be mapped back to the source file. Fixes rust-lang#23301
Xander-AJ
force-pushed
the
fix/problem-matcher-rustc-unicode
branch
from
November 2, 2026 11:12
67c234b to
0d3abd8
Compare
ChayimFriedman2
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #23301
With
rustc-unicodeenabled, rustc prints the location of a diagnostic as╭▸ src/main.rs:2:5instead of--> src/main.rs:2:5. The location line of the$rustcproblem pattern only skipped whitespace,-,>and=before the path, so╭▸became part of the file name and VS Code couldn't match the diagnostic to the open file.I added the unicode location markers to that character class. annotate-snippets (which rustc uses for unicode output) prints
╭▸for the first location,─▸when the location stands alone and├▸for later ones, so all three are covered. The header pattern didn't need changing because theerror[EXXXX]: ...line is the same in both formats.Tested by loading the patterns from package.json into
new RegExpand running them on ASCII and unicode samples from rustc's.unicode.stderrUI tests (e.g. tests/ui/error-emitter/close_window.unicode.stderr). ASCII samples parse as before; unicode ones now give the right file, line and column.AI disclosure: I used an AI assistant to help find the rustc output format and write the regex change. I reviewed the change and can explain it.