Why is this an issue?

Applying the #[inline] attribute to trait methods without provided implementations is pointless because only method implementations can be inlined. The attribute is therefore ignored in such cases, leading to unnecessary code complexity.

Code examples

Noncompliant code example

trait Animal {
    #[inline] // Noncompliant: Inline attribute on trait method without implementation.
    fn name(&self) -> &'static str;
}

Compliant solution

trait Animal {
    fn name(&self) -> &'static str;
}

Resources

Documentation