Post #1366728
2026-04-15 01:24 UTC
@olsonseank That's good to know. I guess I need to run clippy more often.
What kind of use does this kind of unused generic parameter have?
Replies (1)
-
@kornel@mastodon.social 2026-04-15 10:49
@blp inherent methods on some `Type` may not be using the `T` specifically (e.g. `Vec::len`), and self.foo() and foo(self) are equivalent-ish in Rust, so a function with unused generics must exist as a thing. tbh, unused T on a standalone function is as rare and suspicious as in a struct, so the inconsistency in enforcement could be just a historical accident.