Skip to content

Resolve Drop calls #1467

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Resolve Drop calls #1467

wants to merge 4 commits into from

Conversation

Nadrieril
Copy link
Collaborator

@Nadrieril Nadrieril commented May 18, 2025

This PR makes it so we gather the data needed to know what code is called on a drop terminator. To do this well, this adds an optional resolve_drop_bounds option (maybe this should be renamed) which adds T: Drop bounds to every possible generic parameter and associated type. This way, we can reuse the normal ImplExpr system. The one thing that's missing is the implicit Drop impls (so-called "drop glue") that exist for ADTs without an explicit impl Drop; these are represented as DropData::Glue, and generating an adequate Drop impl is left as an exercice for the consumer. I'll see if I can get rustc to give me the right MIR automatically.

Left as draft while I finish the charon side.

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.

1 participant