News for hackers. Stuff that matters.
Re:My favorite Rust function by oconnor663 on Saturday October 12, 2019 @08:22PM (#21237327)
I think `#[may_dangle]` is an exception to this, and the standard library puts it on many (most?) container types.
Re:My favorite Rust function by Rusky on Saturday October 12, 2019 @08:34PM (#21237374)
It is not an exception; #[may_dangle] does not change the time drop runs. All it does is promise that drop will not access borrowed data, allowing that data to die before drop: https://doc.rust-lang.org/nightly/nomicon/dropck.html