Question about takeaway from drop_static<T: 'static>(t: T)
#48
-
Hi, in the very interesting article Common Rust Lifetime Misconceptions you write:
use rand;
fn drop_static<T: 'static>(t: T) {
std::mem::drop(t);
} What you think about It is compiled and run, too. |
Beta Was this translation helpful? Give feedback.
Answered by
WaffleLapkin
Jul 12, 2021
Replies: 1 comment 5 replies
-
Can you please clarify your question? I'm not sure what you are asking. You can drop things which can live up to the end of the program, so you can certainly drop things which live shorter than that as well, so I'm not sure what the question here is. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[playground]