-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relax suspicious_auto_trait_impls
lint wrt lifetimes
#94925
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
again nominating this for a beta backport. the lint isn't on stable yet and we should remove as many incorrect occurrences as possible, similar to #94315. |
suspicious_auto_trait_impls
lintsuspicious_auto_trait_impls
lint wrt lifetimes
r? rust-lang/diagnostics |
| | ||
LL | pub struct WithLifetime<'a, T>(&'a (), T); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: `Vec<T>` is not a generic parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would be a span_label pointing at the right place, not a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it's somewhat difficult to get that using a type visitor 🤔 could maybe improve it by at least pointing at the self type 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's some code somewhere that does exactly that already. It'd be in one of my old PRs.
@bors r+ ...but it seems like the error being avoided should maybe be a warning? |
📌 Commit 82d8e84 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f21488a): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
what exactly do you mean here? The reason for that lint is that we intend to change the behavior of auto traits in the future and want to lint any impls whose semantics change when that happens. Impls only specializing on lifetimes will not change their meaning with my proposed change. |
[beta] backport rust-lang#94925 backports rust-lang#94925 looks like that PR might have slipped through 🤔 does it help if there's an open issue to track that in the future, or are there other things I can do to make this less likely in the future? r? `@Mark-Simulacrum`
fixes the warning for #93367 (comment).