-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
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 Tor&'a RefCell<T>within a valuevwill need to either:
- be attached to a type that is parametric in
'a(which will force'ato strictly outlivev, and thus I think will forceTalso to strictly outlivev), or- be hidden behind a generic type with some method that does the write to
&'a mut Tor&'a RefCell<T>-- but again, I think we will again here see the'aleak up and end up being forced to strictly outlivev?
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.