-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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
Code
pub struct S;
impl fmt::Debug for S {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
Current output
Compiling playground v0.0.1 (/playground)
error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
--> src/lib.rs:2:6
|
2 | impl fmt::Debug for S {
| ^^^ use of undeclared crate or module `fmt`
error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
--> src/lib.rs:3:27
|
3 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
| ^^^ use of undeclared crate or module `fmt`
|
help: consider using the associated function
|
3 | fn fmt(&self, f: &mut self.fmt::Formatter<'_>) -> fmt::Result {
| +++++
error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
--> src/lib.rs:3:50
|
3 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
| ^^^ use of undeclared crate or module `fmt`
|
help: consider using the associated function
|
3 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> self.fmt::Result {
| +++++
For more information about this error, try `rustc --explain E0433`.
error: could not compile `playground` (lib) due to 3 previous errors
Desired output
No suggestion (suggest importing std::fmt)
compiler-errors and izik1
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.