rust-clippy
rust-clippy copied to clipboard
Add `needless_maybe_sized` lint
changelog: new lint: [needless_maybe_sized
]
Closes #10600
r? @giraffate
(rustbot has picked a reviewer for you, use r? to override)
r? Jarcho
I'm not sure if the trace with spans is really worth it. It takes up a lot space and most of the info is not very useful. Is there a way to just print the location without the snippet?
One extension would be to check if any of the traits have functions using Self
by value. e.g.
trait T {
fn foo() -> Self;
}
There's no Sized
bound on the trait, but it's also unimplementable for unsized types.
I don't think there is a way to keep the location while hiding the snippet, but we could make them regular notes
:umbrella: The latest upstream changes (presumably #12259) made this pull request unmergeable. Please resolve the merge conflicts.
I ditched the spans for the trace, doesn't have the location but it seems fine to me. Most of the time it should be clear which traits are the cause but if not the user can always follow the bounds themselves
Too bad there's no option for printing spans like that.
Been a week without objections. Getting the spans printed nicely isn't a blocker and can be added in later.
@bors r+
:pushpin: Commit 0bc60dc4b61e969aa3ee92b700aa125b210a1516 has been approved by Jarcho
It is now in the queue for this repository.
:hourglass: Testing commit 0bc60dc4b61e969aa3ee92b700aa125b210a1516 with merge fb65e02771f85fb7f6e19e1feedfa2900229feb1...
:broken_heart: Test failed - checks-action_dev_test
getting blocked by bors
for this long is kind of unfortunate.
@Jarcho, could you retry running the tests so this can get through?
@bors r+
:pushpin: Commit cf0b55eb6232491a7c29ac0f47564b6ee7adb13e has been approved by Jarcho
It is now in the queue for this repository.
:hourglass: Testing commit cf0b55eb6232491a7c29ac0f47564b6ee7adb13e with merge 6cfd4ac9557bf339db1ddf883a06e017e9f1fb64...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Jarcho Pushing 6cfd4ac9557bf339db1ddf883a06e017e9f1fb64 to master...