New destructor semantics · Issue #8861 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@nikomatsakis

Description

@nikomatsakis

Tracking issue for RFC #769, Sound Generic Drop.

Original description follows:

We agreed in a meeting to replace the unsafe destructor code with the rule that a value with a destructor must only contain values of lifetime strictly greater than the value to be destructed. The idea is to prevent values from referencing one another. Permitting borrowed values in destructors enables a number of RAII causes and helps to eliminate the need for once fns. This also relies on the change to prevent & pointers from being placed within managed boxes (which I think has already been made).

I have to figure out precisely how to formalize this rule still. =)

Nominating for backwards compat.


Update from @pnkfelix : Much of this is implemented, and so pnkfelix is listing out specific subtasks, issues, and/or PRs, to try to track what is done and what is left to do:

Far future / No longer deemed necessary

(See also #22321)