Skip to content

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