-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Anything else?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.