Skip to content

Associated-type where clause is only parsed in the deprecated position, blocking deprecated_where_clause_location lint #4656

Description

@lucasly-ba

The rustc deprecated_where_clause_location lint warns when an associated type's where clause is written before the = (the deprecated position) and suggests moving it after.

gccrs currently parses only the deprecated position and hard-errors on the modern one:

impl Trait for S {
    type Assoc where Self: Sized = Self;   // accepted by gccrs
    // type Assoc = Self where Self: Sized; // gccrs: "expecting `;` but `where` found"
}

Because the corrected form is a parse error, the lint would fire on the only syntax gccrs accepts and have no valid alternative to suggest, so it is not implementable today. Supporting the modern type Assoc = ... where ...; position would both fix a parser gap and unblock the lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions