rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.82k stars 262 forks source link

remove 'fail to call destructors' from okay-list #420

Closed RalfJung closed 1 year ago

RalfJung commented 1 year ago

This would need a bunch of caveats: when data is pinned, it is unsound to not call the destructors (pinning wasn't a thing yet when the nomicon got written); also code can rely on the destructors in its own stack frame to be executed if the stack frame ever gets popped (i.e., longjmp-ing over the stack frame is not okay).