dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.88k stars 311 forks source link

Generics::split_for_impl can cause clippy::multiple_bound_locations #1724

Closed nazar-pc closed 2 months ago

nazar-pc commented 2 months ago

As a user of the library that leverages syn I was hitting https://rust-lang.github.io/rust-clippy/master/index.html#/multiple_bound_locations in generated code and I think there is an opportunity to improve this by making sure Generics::split_for_impl moves all generic bounds into where clause.

Not 100% sure if syn itself is the right place to fix this, but decided to report this anyway in case it is helpful.

dtolnay commented 2 months ago

In my opinion, that clippy lint is not valuable to try to address in macro-generated code. It would be better to turn off the lint in the specific impl that is triggering it.

nazar-pc commented 2 months ago

Can't suppress until the project increases their minimum Rust version to 1.78 or else another warning will be printed, but fair enough.