Closed
Description
Code
struct A;
struct B;
struct C;
struct D;
impl A {
fn b(&self) -> B { B }
}
impl B {
fn c(&self) -> C { C }
fn foo(&self) {}
}
impl C {
fn d(&self) -> D { D }
}
impl D {
fn e(&self) {}
}
fn main() {
A.b().c().d().foo();
}
Current output
error[E0599]: no method named `foo` found for struct `D` in the current scope
--> src/main.rs:21:19
|
4 | struct D;
| -------- method `foo` not found for this struct
...
21 | A.b().c().d().foo();
| ^^^ method not found in `D`
Desired output
error[E0599]: no method named `foo` found for struct `D` in the current scope
--> src/main.rs:21:19
|
2 | struct B;
| -------- method `foo` found for this struct
3 | struct C;
4 | struct D;
| -------- method `foo` not found for this struct
...
21 | A.b().c().d().foo();
| ----- ^^^ method not found in `D`
| |
| method `foo` available after this method call
Rationale and extra context
No response
Other cases
No response