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.
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 arewhere
clause bounds for generics.