-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`
Description
trait A {
type Bla;
fn to_bla(&self) -> Bla;
}
yields
error[E0412]: cannot find type `Bla` in this scope
--> src/main.rs:3:25
|
3 | fn to_bla(&self) -> Bla;
| ^^^ not found in this scope
error: aborting due to previous error
it would be helpful to suggest to change the to_bla
return type to Self::Bla;
which fixes the error:
trait A {
type Bla;
fn to_bla(&self) -> Self::Bla;
}
fn main() {}
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`