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

Insignificant destructors rfc 2229 #84152

Merged
merged 1 commit into from
May 15, 2021

Conversation

null-sleep
Copy link
Contributor

@null-sleep null-sleep commented Apr 13, 2021

  • Adds new attribute rustc_insignificant_dtor to annotate the drop method.
  • Adds a query to check if a type has a significant drop.
  • Updates closure analysis to check for significant drops rather than just drop.

A type marked with the attribute rustc_insignificant_dtor is considered to not be significant. A drop is significant if it is implemented by the user or does anything that will have any observable behavior (other than freeing up memory).

rust-lang/project-rfc-2229#35

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2021
@null-sleep
Copy link
Contributor Author

r? @ghost

@null-sleep
Copy link
Contributor Author

Testing with CI. Local build kept ommitting version = 3 from Cargo.lock

@jyn514 jyn514 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 13, 2021
@crlf0710 crlf0710 added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2021
@crlf0710
Copy link
Member

crlf0710 commented May 1, 2021

Triage: switching to S-experimental since reviewer=ghost.

@rust-log-analyzer

This comment has been minimized.

@null-sleep null-sleep force-pushed the insignificant_dtor branch 2 times, most recently from 5a39524 to f37ed61 Compare May 4, 2021 05:59
Copy link
Member

@arora-aman arora-aman left a comment

Choose a reason for hiding this comment

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

nits, LGTM otherwise

@null-sleep null-sleep changed the title add new attribute rustc_insignificant_dtor and a query to check if a … Insignificant destructors rfc 2229 May 4, 2021
@null-sleep
Copy link
Contributor Author

r? @nikomatsakis

compiler/rustc_middle/src/query/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/query/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/util.rs Outdated Show resolved Hide resolved
compiler/rustc_ty_utils/src/needs_drop.rs Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented May 6, 2021

☔ The latest upstream changes (presumably #84982) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 6, 2021
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Looks great! A few more nits.

compiler/rustc_ty_utils/src/needs_drop.rs Outdated Show resolved Hide resolved
compiler/rustc_ty_utils/src/needs_drop.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented May 12, 2021

☔ The latest upstream changes (presumably #84730) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 15, 2021

📌 Commit a7e1cec has been approved by nikomatsakis

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

bors commented May 15, 2021

⌛ Testing commit a7e1cec with merge b439be0...

@bors
Copy link
Contributor

bors commented May 15, 2021

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing b439be0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 15, 2021
@bors bors merged commit b439be0 into rust-lang:master May 15, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 15, 2021
@crlf0710 crlf0710 removed the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

None yet

10 participants