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

Dangly paths #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Dangly paths #17

wants to merge 8 commits into from

Conversation

pnkfelix
Copy link

The feature being implemented here is sketched out in https://gist.github.com/pnkfelix/6df6975c99d5c4da37136ada9fa44fb0

(I still need to transcribe part of the comments in this code into that gist, analogous to the Detailed Design of an RFC.)

and call *that* from the `drop` NLL statement.

No observable behavior change otherwise (apart from error messages now
say "cannot drop" instead of "cannot move"), but the doc comment
indicates the plans I have (in terms of incorporating `may_dangle`
support).
With this in place, all tests pass.
@RalfJung
Copy link

RalfJung commented Feb 5, 2018

@nikomatsakis sent me here during the recent #[may_dangle] discussion. TIL we have another soundness hole. ;)

I have one question regarding the gist you referenced:

Now, even though the destructor of MessageOnDrop2 does not access its type parameter, dropping it still drops the instance of T, which for eventually_impure means that we run the destructor of PoisonOnDrop (and thus mutate data in the reference).

So we need to be careful.

This "just" means that we have to check all the types along the path in question, right? If things are done properly structurally, recursing over the type, this should just work? Or am I missing something?

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