{"record":{"id":"aced6ae734ecd4da","repo":"rust-lang/rust","slug":"non-terminating-drop-in-place-real","errorCode":null,"errorMessage":"Non terminating drop_in_place_real???","messagePattern":"Non terminating drop_in_place_real\\?\\?\\?","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"compiler/rustc_codegen_cranelift/src/abi/mod.rs","lineNumber":485,"sourceCode":"                    Err(instance) => Some(instance),\n                }\n            }\n            InstanceKind::LlvmIntrinsic(_) => {\n                crate::intrinsics::codegen_llvm_intrinsic_call(\n                    fx,\n                    fx.tcx.symbol_name(instance).name,\n                    args,\n                    ret_place,\n                    target,\n                    source_info.span,\n                );\n                return;\n            }\n            // We don't need AsyncDropGlueCtorShim here because it is not `noop func`,\n            // it is `func returning noop future`\n            InstanceKind::Shim(ShimKind::DropGlue(_, None)) => {\n                // empty drop glue - a nop.\n                let dest = target.expect(\"Non terminating drop_in_place_real???\");\n                let ret_block = fx.get_block(dest);\n                fx.bcx.ins().jump(ret_block, &[]);\n                return;\n            }\n            _ => Some(instance),\n        }\n    } else {\n        None\n    };\n\n    let extra_args = &args[fn_sig.inputs().skip_binder().len()..];\n    let extra_args = fx.tcx.mk_type_list_from_iter(\n        extra_args.iter().map(|op_arg| fx.monomorphize(op_arg.node.ty(fx.mir, fx.tcx))),\n    );\n    let fn_abi = if let Some(instance) = instance {\n        FullyMonomorphizedLayoutCx(fx.tcx).fn_abi_of_instance(instance, extra_args)\n    } else {\n        FullyMonomorphizedLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_sig, extra_args)","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_codegen_cranelift/src/abi/mod.rs#L467-L503","documentation":"This fires in Cranelift codegen's `codegen_terminator_call` when handling `InstanceKind::Shim(ShimKind::DropGlue(_, None))` — empty drop glue that is a no-op. The code does `target.expect(\"Non terminating drop_in_place_real???\")` where `target` is the `Option<BasicBlock>` continuation for the MIR `Call` terminator. Empty drop glue should always return to a target block. If `target` is `None` (a non-returning/diverging call), the codegen panics because a no-op drop has nowhere to jump.","triggerScenarios":"Codegen of a MIR `Call` terminator targeting empty drop glue (a type whose `Drop` impl is trivially empty) where the call has no return target (`target: None`). This means the MIR indicates a diverging call to a function that is actually a no-op, which is contradictory.","commonSituations":"Compiling code that drops a type with no custom Drop logic in a diverging context, or where MIR optimization passes transform a call in a way that drops its return target. Usually indicates a bug in MIR construction or in a MIR optimization pass that dropped the `target` field for a call that should continue.","solutions":["Report as an ICE — this is a compiler bug in MIR construction or a pass, not user code.","Try compiling with `-Zmir-opt-level=0` to disable MIR optimizations that may corrupt the call target.","Try the LLVM backend (`-Zcodegen-backend=llvm`) to determine if the issue is cg_clif-specific or a broader MIR problem.","Minimize the reproduction and file a bug identifying the drop-glue call with `target: None`.","If contributing to cg_clif, the code at `abi/mod.rs:485` could emit a trap instead of panicking when `target` is `None` for empty drop glue."],"exampleFix":"# before (MIR optimization may strip the target for a no-op drop call)\ncargo build\n\n# after (disable MIR optimizations to avoid the corrupt call target)\nRUSTFLAGS='-Zmir-opt-level=0' cargo build","handlingStrategy":"fallback","validationCode":"// No user-level validation for MIR correctness.\n// Fallback: disable MIR optimizations that may corrupt the call target.\n// In Cargo.toml or .cargo/config.toml:\n// [build]\n// rustflags = [\"-Zmir-opt-level=0\"]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Disable MIR optimizations (-Zmir-opt-level=0) if you encounter drop-related ICEs.","Report the MIR body that produces a Drop call with target: None.","Use the LLVM backend as a fallback for drop-heavy code.","Track known cg_clif ICEs on the issue tracker."],"tags":["rustc","cranelift","codegen","ice","drop-glue","mir","compiler-internal"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}