clippy fixes#146540
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
a2b5b92 to
03eba7f
Compare
| where | ||
| T: Borrow<Q> + Ord, | ||
| Q: Ord, | ||
| F: FnOnce(&Q) -> T, |
There was a problem hiding this comment.
In general, I'd personally prefer to see us move towards "if we have a where clause, that's the location of all the bounds" -- e.g., in this case the only change would be to move ?Sized to the Q: Ord line. That should also remove most of the changes you've made I think, which seems like a win, and avoids cases where the new PR splits into two (both where-clause bounds and inline bounds in the generic definition).
There was a problem hiding this comment.
Currently the split is local generics are inside the angle brackets with their bounds, and the impl-level generics are bound in the where clause.
But I can change it if you think that would be better...
There was a problem hiding this comment.
In general I don't think I think multiple_bound_locations makes much sense to worry over fixing. rustdoc normalizes away the differences and if we really cared about normalizing them in code, IMO that should be a rustfmt (optional?) pass. So I think I'd lean towards silencing this lint in our CI/clippy runs.
There was a problem hiding this comment.
Hmm, I hadn't thought of this being rustfmt territory, but that seems like a good idea: rust-lang/rustfmt#6664
|
Going to go ahead and close this per the discussion above, feel free to re-open silencing the lint or otherwise changing it. |
This PR moves the `multiple_bound_locations` lint from `suspicious` to `style`. The `suspicious` category is described as "code that is most likely wrong or useless", which is not the case here at all, so `style` seems more fitting. Fixes #15736, with some prior discussion at rust-lang/rust#146540. changelog: move `multiple_bound_locations` lint to `style` group
Fixes for clippy::multiple_bound_locations.