about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/abi
diff options
context:
space:
mode:
authorAndrew Zhogin <andrew.zhogin@gmail.com>2024-08-26 16:45:15 +0300
committerAndrew Zhogin <andrew.zhogin@gmail.com>2025-04-28 16:23:13 +0700
commitc366756a8537ef998d32c1ef57098d5aae7ca92f (patch)
tree9e2bb71eee25b90a0ddee1b15ed8ba339d5f0d9e /compiler/rustc_codegen_cranelift/src/abi
parent52c1838fa712ee60d35b0d8cb6d4df3225430176 (diff)
AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/abi')
-rw-r--r--compiler/rustc_codegen_cranelift/src/abi/mod.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
index ddd119e0c61..5f631405a9a 100644
--- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
@@ -441,7 +441,9 @@ pub(crate) fn codegen_terminator_call<'tcx>(
                     Err(instance) => Some(instance),
                 }
             }
-            InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) => {
+            // We don't need AsyncDropGlueCtorShim here because it is not `noop func`,
+            // it is `func returning noop future`
+            InstanceKind::DropGlue(_, None) => {
                 // empty drop glue - a nop.
                 let dest = target.expect("Non terminating drop_in_place_real???");
                 let ret_block = fx.get_block(dest);
@@ -707,9 +709,8 @@ pub(crate) fn codegen_drop<'tcx>(
     let ty = drop_place.layout().ty;
     let drop_instance = Instance::resolve_drop_in_place(fx.tcx, ty);
 
-    if let ty::InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) =
-        drop_instance.def
-    {
+    // AsyncDropGlueCtorShim can't be here
+    if let ty::InstanceKind::DropGlue(_, None) = drop_instance.def {
         // we don't actually need to drop anything
     } else {
         match ty.kind() {