rust-lang / rust-lang/rust-analyzer
Quick fix to add method to trait on "... is not a member of trait ..." error
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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