Re:Bastion of the Turbofish (2020)
by baby on Friday February 05, 2021 @12:37AM
(#26033469)
It’s also never clear where this appears, like a::<b>(c) or a::<b>::c()
[ Parent
| on HN ]
Re:Bastion of the Turbofish (2020)
by unrealhoang on Friday February 05, 2021 @01:08AM
(#26033602)
in both case, `<b>` is a parameter of `a`, but in the former, `a` is a function with generic parameter and in the latter, `a` is a type with generic parameter.
The generic paramer is directly after the thing that has the parameter (it could be on the type or the method). With an exception, for enum variants it's after the variant, like None::<i32>