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

Fix broken behaviour for NoFinalize trait #39

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

jacob-hughes
Copy link
Collaborator

Previously std::mem::needs_finalize<T>() would only return true if
the top-level type required finalizing. This now traverses component
types correctly. See test/ui/gc/needs_finalize.rs for a detailed list
of which types need finalizing.

A lot of the refactoring in needs_drop comes from breaking changes in
upstream.

Previously `std::mem::needs_finalize<T>()` would only return `true` if
the top-level type required finalizing. This now traverses component
types correctly. See `test/ui/gc/needs_finalize.rs` for a detailed list
of which types need finalizing.

A lot of the refactoring in `needs_drop` comes from breaking changes in
upstream.
res
}

enum DropCheckType {
Copy link
Member

Choose a reason for hiding this comment

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

A maybe-silly question: will this enum only ever have two values? If so, is it a boolean in disguise? [The needs_finalizer check suggests it is, but I might be over-simplifying!]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a bool check in disguise yes. That may change in future because newer versions of rustc seem to have introduced the notion of a significant dropck: same behaviour as dropck but some drop methods can be marked as insignificant with a #[insignificant_drop] attribute.

Copy link
Member

Choose a reason for hiding this comment

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

Aha, OK, then let's keep the enum!

@ltratt
Copy link
Member

ltratt commented Jul 30, 2021

bors r+

@bors
Copy link

bors bot commented Jul 30, 2021

Build succeeded:

@bors bors bot merged commit 353e62d into softdevteam:master Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants