Suggest assoc type on type not found in trait method definition

This commit is contained in:
Esteban Küber 2019-07-13 19:20:28 -07:00
parent 69656fa4cb
commit 6b9580b651
3 changed files with 85 additions and 34 deletions

View file

@ -0,0 +1,7 @@
trait A {
type Bla;
fn to_bla(&self) -> Bla;
//~^ ERROR cannot find type `Bla` in this scope
}
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0412]: cannot find type `Bla` in this scope
--> $DIR/assoc-type-in-method-return.rs:3:25
|
LL | fn to_bla(&self) -> Bla;
| ^^^ help: try: `Self::Bla`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.