Skip to content
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

Allow more !Copy impls #101875

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Conversation

fmease
Copy link
Member

@fmease fmease commented Sep 15, 2022

You can already implement !Copy for a lot of types (with #![feature(negative_impls)]). However, before this PR you could not implement !Copy for ADTs whose fields don't implement Copy which didn't make any sense. Further, you couldn't implement !Copy for types impl'ing Drop (equally nonsensical).

@rustbot label T-types F-negative_impls
Fixes #101836.

r? types

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 15, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2022
@rustbot rustbot added F-negative_impls #![feature(negative_impls)] T-types Relevant to the types team, which will review and decide on the PR/issue. labels Sep 15, 2022
@fmease fmease force-pushed the allow-more-negative-copy-impls branch 2 times, most recently from 42a7499 to 7b2daf6 Compare September 15, 2022 23:19
@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the allow-more-negative-copy-impls branch 2 times, most recently from d1ccfd3 to 3d2e116 Compare September 16, 2022 10:26
@fmease

This comment was marked as outdated.

@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the allow-more-negative-copy-impls branch from 3d2e116 to d0954bf Compare September 16, 2022 10:37
@rustbot
Copy link
Collaborator

rustbot commented Sep 16, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@fmease fmease force-pushed the allow-more-negative-copy-impls branch from d0954bf to 564de74 Compare September 18, 2022 14:38
@compiler-errors
Copy link
Member

r? types (am sick right now, can't review much)

@fmease fmease force-pushed the allow-more-negative-copy-impls branch from 564de74 to 3a0362f Compare September 23, 2022 17:37
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, then r=me

@fmease fmease force-pushed the allow-more-negative-copy-impls branch from 3a0362f to d201498 Compare September 23, 2022 19:33
@fmease
Copy link
Member Author

fmease commented Sep 23, 2022

Okay, now using bug!() (just like in the Drop visitor). I've slightly simplified the implementation (making things less awkward) and now point at the self-type in all branches which is more consistent, too. I hope that's fine. I've blessed the relevant tests.

one nit, then r=me

I don't think I can do [@]bors r=lcnr without delegation.

@bors
Copy link
Contributor

bors commented Sep 23, 2022

@fmease: 🔑 Insufficient privileges: Not in reviewers

@fmease fmease force-pushed the allow-more-negative-copy-impls branch from d201498 to 28e0c5a Compare September 23, 2022 19:52
@fmease
Copy link
Member Author

fmease commented Sep 23, 2022

ready

@lcnr
Copy link
Contributor

lcnr commented Sep 26, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 26, 2022

📌 Commit 28e0c5a has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 26, 2022
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Sep 26, 2022
…pls, r=lcnr

Allow more `!Copy` impls

You can already implement `!Copy` for a lot of types (with `#![feature(negative_impls)]`). However, before this PR you could not implement `!Copy` for ADTs whose fields don't implement `Copy` which didn't make any sense. Further, you couldn't implement `!Copy` for types impl'ing `Drop` (equally nonsensical).

`@rustbot` label T-types F-negative_impls
Fixes rust-lang#101836.

r? types
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 26, 2022
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#101875 (Allow more `!Copy` impls)
 - rust-lang#101996 (Don't duplicate region names for late-bound regions in print of Binder)
 - rust-lang#102181 (Add regression test)
 - rust-lang#102273 (Allow `~const` bounds on non-const functions)
 - rust-lang#102286 (Recover some items that expect braces and don't take semicolons)

Failed merges:

 - rust-lang#102314 (Add a label to struct/enum/union ident name)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4d4a369 into rust-lang:master Sep 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 26, 2022
@fmease fmease deleted the allow-more-negative-copy-impls branch September 27, 2022 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-negative_impls #![feature(negative_impls)] S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

negative impl for Copy fails in a strange way
7 participants