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

Improve duplicate derive Copy/Clone diagnostics #131153

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

VulnBandit
Copy link
Contributor

@VulnBandit VulnBandit commented Oct 2, 2024

Improve duplicate derive Copy/Clone diagnostics.
Closes #131083

@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 2, 2024
@VulnBandit VulnBandit marked this pull request as draft October 2, 2024 13:16
@jieyouxu jieyouxu changed the title [WIP] Fix Double Copy implementation vulnerability [WIP] Improve duplicate derive Copy diagnostics Oct 2, 2024
@jieyouxu jieyouxu changed the title [WIP] Improve duplicate derive Copy diagnostics [WIP] Improve duplicate derive Copy/Clone diagnostics Oct 2, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. I left some initial feedback, not taking this review because I'm busy with other things. Please consult with the dev-guide on UI error annotations and how to bless your tests. I also took the liberty to rename your PR title and description to better reflect that this is indeed a diagnostic improvement not a security-related vulnerability fix.

tests/ui/derives/issue-131083.rs Outdated Show resolved Hide resolved
tests/ui/derives/issue-131083.rs Outdated Show resolved Hide resolved
tests/ui/derives/issue-131083.rs Outdated Show resolved Hide resolved
@jieyouxu
Copy link
Member

jieyouxu commented Oct 2, 2024

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 2, 2024
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

A couple more nits.

@lqd
Copy link
Member

lqd commented Oct 2, 2024

The two files you've added will also be need to be set to non-executable.

@VulnBandit VulnBandit changed the title [WIP] Improve duplicate derive Copy/Clone diagnostics Improve duplicate derive Copy/Clone diagnostics Oct 3, 2024
@VulnBandit VulnBandit marked this pull request as ready for review October 3, 2024 09:53
@VulnBandit
Copy link
Contributor Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 3, 2024
@compiler-errors
Copy link
Member

Please squash this into one commit, as well

@VulnBandit
Copy link
Contributor Author

@rustbot review

@lqd
Copy link
Member

lqd commented Oct 3, 2024

why is "vulnerability" in the commit message?

@compiler-errors
Copy link
Member

vulnerability 😭 this is a diagnostics issue

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

why is "vulnerability" in the commit message?

They might not be a native English speaker. I updated the PR title/description to not use "vulnerability" but forgor to mention the "vulnerability" in the commit message previously.

@VulnBandit
Copy link
Contributor Author

Ok sorry I will update the commit message

@rust-log-analyzer

This comment has been minimized.

@VulnBandit
Copy link
Contributor Author

Thank you everybody I HAD A Typo can you approve workflow ? thanks

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 14, 2024

📌 Commit 5bb72cc has been approved by compiler-errors

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 Oct 14, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2024
…ler-errors

Improve duplicate derive Copy/Clone diagnostics

Improve duplicate derive Copy/Clone diagnostics.
Closes rust-lang#131083
@matthiaskrgr
Copy link
Member

might need rebase #131709 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 14, 2024
@VulnBandit
Copy link
Contributor Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2024
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 4, 2024

📌 Commit e3029ab has been approved by compiler-errors

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 Nov 4, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Nov 5, 2024
…ler-errors

Improve duplicate derive Copy/Clone diagnostics

Improve duplicate derive Copy/Clone diagnostics.
Closes rust-lang#131083
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#131153 (Improve duplicate derive Copy/Clone diagnostics)
 - rust-lang#131341 (Support clobber_abi and vector registers (clobber-only) in PowerPC inline assembly)
 - rust-lang#132025 (fix suggestion for diagnostic error E0027)
 - rust-lang#132153 (Stabilise `const_char_encode_utf16`.)
 - rust-lang#132303 (More tests for non-exhaustive C-like enums in FFI)
 - rust-lang#132473 ([core/fmt] Replace checked slice indexing by unchecked to support panic-free code)
 - rust-lang#132598 (Clippy: Move some attribute lints to be early pass (post expansion))
 - rust-lang#132606 (Improve example of `impl Pattern for &[char]`)
 - rust-lang#132609 (docs: fix grammar in doc comment at unix/process.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#131153 (Improve duplicate derive Copy/Clone diagnostics)
 - rust-lang#132025 (fix suggestion for diagnostic error E0027)
 - rust-lang#132303 (More tests for non-exhaustive C-like enums in FFI)
 - rust-lang#132492 (remove support for extern-block const intrinsics)
 - rust-lang#132587 (Revert "Avoid nested replacement ranges" from rust-lang#129346.)
 - rust-lang#132596 ([rustdoc] Fix `--show-coverage` when JSON output format is used)
 - rust-lang#132598 (Clippy: Move some attribute lints to be early pass (post expansion))
 - rust-lang#132601 (Update books)
 - rust-lang#132606 (Improve example of `impl Pattern for &[char]`)
 - rust-lang#132608 (document `type_implements_trait`)
 - rust-lang#132609 (docs: fix grammar in doc comment at unix/process.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 972fef2 into rust-lang:master Nov 5, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2024
Rollup merge of rust-lang#131153 - VulnBandit:copy_impl_vuln, r=compiler-errors

Improve duplicate derive Copy/Clone diagnostics

Improve duplicate derive Copy/Clone diagnostics.
Closes rust-lang#131083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deriving Clone and Copy twice generates bad diagnostics
9 participants