rust-lang / rust-lang/rust-analyzer

Quick fix to add method to trait on "... is not a member of trait ..." error

Open
#12,682 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-assists A-diagnostics C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Basically going from

trait Foo {}

impl Foo for () {
    fn foo(&self) {}
 // ^^^^^^^^^^^^^^^^ method `foo` is not a member of trait `Foo`
}

to

trait Foo {
    fn foo(&self);
}

impl Foo for () {
    fn foo(&self) {}
}

This should probably only trigger for local traits.

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

No file, test, or entry point is named. Use the reported diagnostic and examples as the starting point; done means a quick fix can add the missing method to a local trait while avoiding traits defined elsewhere, with coverage for the shown cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.