-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make lint missing-copy-implementations honor negative Copy
impls
#114248
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
Make lint missing-copy-implementations honor negative Copy
impls
#114248
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
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 haven't tested conditional negative Copy
impls since those are broken anyway I think? See #79098.
compiler/rustc_lint/src/builtin.rs
Outdated
|
||
tcx.infer_ctxt() | ||
.build() | ||
.evaluate_obligation(&obligation) |
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.
Can we use predicate_may_hold
here instead?
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.
Now using predicate_may_hold
. That's much shorter and more legible, thanks for the suggestion!
However, I'm wondering if that could yield too many false positives since we're now considering ambiguous negative impls to be applicable (as well as ones that apply modulo opaque types).
Wouldn't predicate_must_hold_modulo_regions
be a better fit?
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.
Yes, sorry about that. I think you're correct, predicate_must_hold_modulo_regions
is the right method to use here I think.
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.
Done
0fa45de
to
a0d8d28
Compare
This comment has been minimized.
This comment has been minimized.
a0d8d28
to
2b8a3b4
Compare
cc @spastorino for negative impls change |
I'm working on different things related to negative impls but it makes sense to me that this lint honor negative |
@bors r+ rollup |
…copy-impl, r=b-naber Make lint missing-copy-implementations honor negative `Copy` impls Fixes rust-lang#101980. `@rustbot` label A-lint F-negative_impls
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#114029 (Explain more clearly why `fn() -> T` can't be `#[derive(Clone)]`) - rust-lang#114248 (Make lint missing-copy-implementations honor negative `Copy` impls) - rust-lang#114498 (Print tidy command with bless tidy check failure) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #101980.
@rustbot label A-lint F-negative_impls