Suggest assoc type on type not found in trait method definition
This commit is contained in:
parent
69656fa4cb
commit
6b9580b651
3 changed files with 85 additions and 34 deletions
7
src/test/ui/suggestions/assoc-type-in-method-return.rs
Normal file
7
src/test/ui/suggestions/assoc-type-in-method-return.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
trait A {
|
||||
type Bla;
|
||||
fn to_bla(&self) -> Bla;
|
||||
//~^ ERROR cannot find type `Bla` in this scope
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue