Skip to content

Underline all the places where the substitutions have taken place #50977

Closed
@estebank

Description

@estebank

After #50943 exposes multiple substitutions in suggestions, we should improve the output of the diagnostic to underline all the places where the substitutions have taken place:

Before:

error[E0643]: method `foo` has incompatible signature for trait
  --> $DIR/impl-generic-mismatch.rs:18:12
   |
LL |     fn foo(&self, _: &impl Debug);
   |                       ---------- declaration in trait here
...
LL |     fn foo<U: Debug>(&self, _: &U) { }
   |            ^ expected `impl Trait`, found generic parameter
help: try removing the generic parameter and using `impl Trait` instead
   |
LL |     fn foo(&self, _: &impl Debug) { }
   |

After:

error[E0643]: method `foo` has incompatible signature for trait
  --> $DIR/impl-generic-mismatch.rs:18:12
   |
LL |     fn foo(&self, _: &impl Debug);
   |                       ---------- declaration in trait here
...
LL |     fn foo<U: Debug>(&self, _: &U) { }
   |            ^ expected `impl Trait`, found generic parameter
help: try removing the generic parameter and using `impl Trait` instead
   |
LL |     fn foo(&self, _: &impl Debug) { }
   |           ^           ^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions