You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggest using -> impl Trait when returning type parameter -> T where T: Trait #85991
Some newcomers are confused by impl Trait in return position because they have first internalized impl Trait as an alias for type parameters in argument position. Because of this, some people try the following:
traitTrait{}implTraitfor(){}// this worksfnfoo() -> implTrait{()}// this doesn'tfnbar<T:Trait>() -> T{()}
We don't currently point them in the right direction, like we do in other cases.
Activity
Noratrieb commentedon Sep 28, 2021
@rustbot claim
Rollup merge of rust-lang#89892 - Nilstrieb:suggest-return-impl-trait…
jackh726 commentedon Feb 19, 2022
Should have been closed by #89892