#[derive(TransparentWrapper)]
doesn't work with where
clause generic bounds.
#241
Labels
proc-macros
I don't do proc-macros, but I accepts PRs about them.
Here is a MWE of code that I have:
However, this gives the error
because the macro generates
rather than
The solution is to do this instead:
However, as of Rust 1.78, clippy now gives the following message:
bound is defined in more than one place
because#[warn(clippy::multiple_bound_locations)]
is on by default, and it can only be turned off at the module level because#[allow(clippy::multiple_bound_locations)]
needs to be applied to the macro generated code.Suggestion 1: avoid using
where
clauses for generics in the macro generated code.Suggestion 2: add
#[allow(clippy::multiple_bound_locations)]
to the macro generated code.Suggestion 3: generate correct code when there are
where
clause bounds for generics.The text was updated successfully, but these errors were encountered: