Skip to content

Suggest appropriate place for type argument after associated type #57385

Description

@estebank

Like we do for lifetimes, suggest the appropriate place for type arguments written after associated an type.

Given

trait Trait<T> { type Item; }
pub fn test<W, I: Trait<Item=(), W> >() {}
fn main() { }

we currently emit

error: type parameters must be declared prior to associated type bindings
  --> $DIR/issue-32214.rs:5:34
   |
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
   |                                  ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions