Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
0 points
Rusky
6y ago
0 comments
Share
This is incorrect. Values still go out of scope and have their destructors run at the same time.
NLL only affects values
without
destructors.
undefined | Better HN
0 comments
default
newest
oldest
oconnor663
6y ago
I think `#[may_dangle]` is an exception to this, and the standard library puts it on many (most?) container types.
Rusky
OP
6y ago
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
j
/
k
navigate · click thread line to collapse