Skip to content

Instantly share code, notes, and snippets.

impl Trait

Is the same syntax for both

  • anonymous generic parameters
  • inferred return types

E.g. in the function fn f<T: Trait1>(t: T, u: impl Trait2) -> impl Trait3 you have one named generic parameter, one anonymous generic parameter and a return type inferred from the function body.