Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
estebank opened this issue May 22, 2018 · 0 comments
Closed

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

estebank opened this issue May 22, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@estebank
Copy link
Contributor

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) { }
   |           ^           ^^^^^^^^^^
@estebank estebank added the A-diagnostics Area: Messages for errors, warnings, and lints label May 22, 2018
estebank added a commit to estebank/rust that referenced this issue May 24, 2018
kennytm added a commit to kennytm/rust that referenced this issue May 26, 2018
…ions, r=petrochencov

Underline multiple suggested replacements in the same line

<img width="685" alt="screen shot 2018-05-22 at 21 06 48" src="https://user-images.githubusercontent.com/1606434/40403051-174f3180-5e04-11e8-86b6-261630c5ff80.png">

Follow up to rust-lang#50943.

Fix rust-lang#50977.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant