Rust开发了一个聪明的内存管理系统,但我有以下情况:
loop {
let mut example = Very_Complicated_Struct::new();
// very complicated data structure created
dealing_with(&mut example);
}
// End of scope, so Rust is supposed to automatically drop the
// memory of example here, which is time consuming
time_demanding_steps();
// But I want Rust to drop memory here,
// after the time_demanding_steps()
Run Code Online (Sandbox Code Playgroud)
Rust有办法这么做吗?