Rust-GCC / Rust-GCC/gccrs

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

Open
#4,656 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.9k
Forks
230
Avg merge
19h 55m
Merged PRs (30d)
67

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two associated-type declarations from the issue and trace the gccrs parser path for type Assoc = ... where ...;. Done means the modern where-clause position parses successfully while the deprecated position remains accepted for the deprecated_where_clause_location lint to diagnose.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.