-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.T-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
I just spent far too long trying to figure out the problem with the following (reduced) code
struct X { i: isize }
impl X {
fn a(&self, i: usize)
{ }
fn b(&self)
{ a(self, 2) }
}
Which produces the error:
Checking playground v0.0.1 (/playground)
error[E0425]: cannot find function `a` in this scope
--> src/lib.rs:8:7
|
8 | { a(self, 2) }
| ^ not found in this scope
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
While I don't expect the code to compile, perhaps mention when trying to call a(self,...)
that I should be calling self.a(...)
?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.T-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.