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

amend RFC 769 (sound generic drop) re: drop via &mut T overwrite #1103

Closed
pnkfelix opened this issue May 2, 2015 · 2 comments
Closed

amend RFC 769 (sound generic drop) re: drop via &mut T overwrite #1103

pnkfelix opened this issue May 2, 2015 · 2 comments
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented May 2, 2015

spawned off of: #769 (comment) :

@glaebhoerl notes:

The impl Drop for T can also be invoked through an &mut T, e.g. assignment through it invokes the destructor on the previous value. This possibility doesn't appear to be covered by "the type of v owns data of type T".

@pnkfelix replies:

any destructor that actually writes to a contained &'a mut T or &'a RefCell<T> within a value v will need to either:

  • be attached to a type that is parametric in 'a (which will force 'a to strictly outlive v, and thus I think will force T also to strictly outlive v), or
  • be hidden behind a generic type with some method that does the write to &'a mut T or &'a RefCell<T> -- but again, I think we will again here see the 'a leak up and end up being forced to strictly outlive v?
@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the RFC. label Aug 30, 2016
@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

Triage: @pnkfelix what's the status of this?

@pnkfelix
Copy link
Member Author

nothings been done. At this point I guess the real place to file such an issue would be the nomicon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants