-
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 lints
Description
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
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints