Skip to content

Improve generic arg–param mismatch errors #68437

Closed

Description

@varkor

The current diagnostics are a little ad hoc and rely on counting the number of mismatches (e.g. they will only produce an error for the first mismatch). It would be nice to produce diagnostics like:

missing generic arguments for `T`, `const N: usize`, `U`

cc @eddyb

This issue has been assigned to @rakshith-ravi via this comment.

Activity

  1. added
    C-cleanup
    A-diagnostics
    T-compiler
    on Jan 21, 2020
  2. varkor commented on Jan 21, 2020

    @varkor
    ContributorAuthor

    This is follow up work for #68434.

  3. contrun commented on Mar 13, 2020

    @contrun

    Please give more context on this. I am not sure the error message of which test should be improved.

  4. eddyb commented on Mar 13, 2020

    @eddyb
    Contributor

    @contrun This is more of the kind of issue opened to avoid forgetting about finishing some work, sorry for the confusion.

    That is, this is @varkor leaving a TODO to themselves about improving the diagnostics from #68434.

  5. contrun commented on Mar 13, 2020

    @contrun

    Ok. I see. Thanks for the explanation.

  6. eddyb commented on Mar 13, 2020

    @eddyb
    Contributor

    That said, if @varkor is too busy to work on this, you could talk to them on Discord or Zulip to see what their plans were, and maybe turn this into a mentored issue.

  7. varkor commented on Mar 14, 2020

    @varkor
    ContributorAuthor

    The idea is essentially this. We currently emit errors telling the user that the generic arguments they provide are in the wrong order: https://github.com/rust-lang/rust/pull/68434/files#diff-5df0144261224cec2047029de05fa827R107
    However, what we'd like to do is suggest reordering the parameters, and let rustfix automatically apply the suggestion.

    I don't have the bandwidth to work on this at the moment, or any time soon, so if anyone is interested in tackling it, I'll be happy to mentor the issue.

  8. added
    E-mentor
    on Mar 14, 2020
  9. rakshith-ravi commented on May 9, 2020

    @rakshith-ravi
    Contributor

    @varkor would you mind if I take this up?

  10. varkor commented on May 9, 2020

    @varkor
    ContributorAuthor

    @rakshith-ravi: you're very welcome to! Let me know if you need any guidance in tackling this issue!

  11. rakshith-ravi commented on May 10, 2020

    @rakshith-ravi
    Contributor

    @rustbot claim

  12. self-assigned this
    on May 10, 2020
  13. added 4 commits that reference this issue on Jun 21, 2020
    005b222
    103b0e3
    f441819
    59e87c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsC-cleanupE-mentorT-compiler

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions