rust/compiler
Nilstrieb 4bed7485da Suggest impl Trait return type
Address #85991

Suggest the `impl Trait` return type syntax if the user tried to return a generic parameter and we get a type mismatch

The suggestion is not emitted if the param appears in the function parameters, and only get the bounds that actually involve `T: ` directly

It also checks whether the generic param is contained in any where bound (where it isn't the self type), and if one is found (like `Option<T>: Send`), it is not suggested.

This also adds `TyS::contains`, which recursively vistits the type and looks if the other type is contained anywhere
2022-02-18 20:40:08 +01:00
..
2022-02-15 16:19:59 +11:00
2022-02-13 11:49:52 +01:00
2022-02-13 11:49:52 +01:00
2022-02-15 16:19:59 +11:00
2022-02-15 16:03:24 +11:00
2022-02-12 11:23:53 +00:00
2022-02-15 16:19:59 +11:00
2022-02-15 16:19:59 +11:00
2022-02-15 16:19:59 +11:00
2022-02-15 16:19:59 +11:00