Respect MSRV (MAYBE_BOUND_IN_WHERE)#12388
Conversation
y21
left a comment
There was a problem hiding this comment.
+1 for having this be part of the trait_bounds pass, fits nicely with the other lints, and also nice seeing the cannot_combine_maybe_bound function get some use
| { | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Can we have a test case for something like
fn f<'a, a: Sized>() where 'a: 'static {}where the type parameter is named after a lifetime? I think this currently happens to work (ie not get linted) because the name of lifetimes include the quote, which differentiates them, but it would be good to have this as a guarantee in the testsuite.
| impl_lint_pass!(TraitBounds => [TYPE_REPETITION_IN_BOUNDS, TRAIT_DUPLICATION_IN_BOUNDS, MULTIPLE_BOUND_LOCATIONS]); | ||
|
|
||
| impl<'tcx> LateLintPass<'tcx> for TraitBounds { | ||
| fn check_generics(&mut self, cx: &LateContext<'tcx>, gen: &'tcx Generics<'_>) { |
There was a problem hiding this comment.
Since we now not only lint on functions, but also impls and a bunch of other items, I wonder how this interacts with derive macros such as Debug. Would be good to have a test, to make sure it doesn't lint here:
#[derive(Debug)]
struct S<T> where T: Sized { t: T }|
Hmm, looking more closely into the lints covered by this pass... Doesn't the |
|
☔ The latest upstream changes (presumably #12077) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Hey @sanxiyn , this is a ping from triage. There hasn't been any activity for some time, just want to check in and make sure that you're still working on this PR. |
|
Hey this is triage, I'm closing this due to inactivity. If you want to continue this implementation, you're welcome to create a new PR. Thank you for the time, you already put into this! Interested parties are welcome to pick this implementation up as well :) @rustbot label +S-inactive-closed -S-waiting-on-author -S-waiting-on-review |
Fix #12370.
changelog: [
multiple_bound_locations]: respect MSRV for combining?Sizedbound