Open JoJoJet opened 2 years ago
I don't think this would be correct. #[inline]
provides a hint to the compiler, and that hint has an effect even when the function is generic. Not only will rustc place the inline
LLVM attribute on the function, it will also generate code for the function within every codegen unit that references it (normally a function is only generated in a single codegen unit).
What it does
Generic functions already allow cross-crate inlining, so clippy should warn about marking one of these functions with #[inline]`.
Lint Name
unnecessary_inline
Category
style
Advantage
Code is less noisy.
Drawbacks
Some users may prefer to use the inline attribute even when it is redundant.
Example
Could be written as: