Skip to content

Multiple unused formatting argument notes should use multispan #37718

Closed
@brson

Description

@brson

After #37613, the output for format! errors looks like:

error: multiple unused formatting arguments
  --> $DIR/format-foreign.rs:12:5
   |
12 |     println!("%.*3$s %s!/n", "Hello,", "World", 4);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: argument never used
  --> $DIR/format-foreign.rs:12:30
   |
12 |     println!("%.*3$s %s!/n", "Hello,", "World", 4);
   |                              ^^^^^^^^
note: argument never used
  --> $DIR/format-foreign.rs:12:40
   |
12 |     println!("%.*3$s %s!/n", "Hello,", "World", 4);
   |                                        ^^^^^^^
note: argument never used
  --> $DIR/format-foreign.rs:12:49
   |
12 |     println!("%.*3$s %s!/n", "Hello,", "World", 4);
   |                                                 ^
   = help: `%.*3$s` should be written as `{:.2$}`
   = help: `%s` should be written as `{}`
   = note: printf formatting not supported; see the documentation for `std::fmt`
= note: this error originates in a macro outside of the current crate

that's a lot of lines dedicated to underlining macro acruments. They should all be output in one multispan.

cc @DanielKeep @estebank @jonathandturner @GuillaumeGomez

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions