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

Outdated info in nomicon on drop flags #38481

Closed
XMPPwocky opened this issue Dec 20, 2016 · 2 comments
Closed

Outdated info in nomicon on drop flags #38481

XMPPwocky opened this issue Dec 20, 2016 · 2 comments

Comments

@XMPPwocky
Copy link
Contributor

XMPPwocky commented Dec 20, 2016

As of Rust 1.0, the drop flags are actually not-so-secretly stashed in a hidden field of any type that implements Drop. Rust sets the drop flag by overwriting the entire value with a particular bit pattern. This is pretty obviously Not The Fastest and causes a bunch of trouble with optimizing code. It's legacy from a time when you could do much more complex conditional initialization.

As such work is currently under way to move the flags out onto the stack frame where they more reasonably belong. Unfortunately, this work will take some time as it requires fairly substantial changes to the compiler.

https://github.com/rust-lang/rust/blob/master/src/doc/nomicon/drop-flags.md

The work described landed in #33622, so this is now out of date.

@sanxiyn
Copy link
Member

sanxiyn commented Feb 14, 2017

See #39304.

@steveklabnik
Copy link
Member

this has been fixed

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

No branches or pull requests

4 participants