]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/build/expr/as_rvalue.rs
Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb
[rust.git] / src / librustc_mir / build / expr / as_rvalue.rs
index 9a756cdfb418e1dc49938a3a53e2c3d26937bd14..7bd9a241a534ef3eaa72b58000e894f18dc5f4f0 100644 (file)
@@ -102,7 +102,9 @@ fn expr_as_rvalue(&mut self,
                 });
                 if let Some(scope) = scope {
                     // schedule a shallow free of that memory, lest we unwind:
-                    this.schedule_drop(expr_span, scope, &Place::Local(result), value.ty);
+                    this.schedule_drop_storage_and_value(
+                        expr_span, scope, &Place::Local(result), value.ty,
+                    );
                 }
 
                 // malloc some memory of suitable type (thus far, uninitialized):