-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
While working on #41256, @jonathandturner proposed a specific syntax for having multiple primary errors on one line, like the example below. This required changes to the way the DiagnosticBuilder
works and since I don't have enough knowledge of the codebase I am writing this follow-up issue.
An error with multiple unused arguments will look like the example below after merging #41256.
error: multiple unused formatting arguments
--> /Users/nickvernij/Programming/rust/src/test/ui/macros/format-foreign.rs:12:5
|
12 | println!("%.*3$s %s!/n", "Hello,", "World", 4);
| ^^^^^^^^^^^^^^^^^^^^^^^^^--------^^-------^^-^^
| | | |
| | | unused
| | unused
| unused
|
This example is having the same kind of error multiple times in one expression, and would ultimately look something like the example below since we try to avoid having both primary and secondary underlines on the same spans:
error: multiple unused formatting arguments
--> /Users/nickvernij/Programming/rust/src/test/ui/macros/format-foreign.rs:12:5
|
12 | println!("%.*3$s %s!/n", "Hello,", "World", 4);
| ^^^^^^^^ ^^^^^^^ ^
| | | |
| ------------------------- unused
oli-obk and solsonperryprog
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.