-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
expose needs_drop under mem #41892
expose needs_drop under mem #41892
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
Fixed the whitespace errors (had auto-whitespace-trimming disabled since Swift people got mad when you fixed that). The unstable book error thing is uh, new to me. |
cc @rust-lang/libs @rust-lang/lang |
👍 |
/// | ||
/// This is purely an optimization hint, and may be implemented conservatively. | ||
/// For instance, always returning `true` would be a valid implementation of | ||
/// this function. |
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.
So there's some backstory here: basically this was never implemented in the compiler in a principled way, to account for associated types. I've made the Copy
check recursive recently but I don't believe that's relevant here.
What's left is to normalize associated type projections in the recursion and/or make an auto trait and rely on the trait system to handle the structural recursion involved here. cc @nikomatsakis
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.
@eddyb Is this a bug in the current implementation, and if so, is there an issue tracking it? If not, could you maybe expand on why needs_drop
cannot be accurate?
☔ The latest upstream changes (presumably #41847) made this pull request unmergeable. Please resolve the merge conflicts. |
ping @gankro looks like this needs a rebase? Looks like there's not a whole lot of opinions here, and we don't have a huge amount of ceremony about unstable apis, so I can r+ when you've rebased |
@aturon You nominated but didn't label with any teams, I've added both that you pinged (T-lang and T-libs). |
Rebased. |
@bors r=alexcrichton |
📌 Commit 1f01b09 has been approved by |
expose needs_drop under mem Note that I purposefully didn't update the intrinsic's documentation, because I think it makes sense for it be more... "honest" about its semantics.
Note that I purposefully didn't update the intrinsic's documentation, because I think it makes sense for it be more... "honest" about its semantics.