1
Fork 0

Make async drop code more consistent with regular drop code

Fixes #126573
This commit is contained in:
Daria Sukhonina 2024-06-17 17:00:45 +03:00
parent f873ae029e
commit af10880f6b
4 changed files with 67 additions and 14 deletions

View file

@ -288,6 +288,7 @@ pub fn transform_instance<'tcx>(
mut instance: Instance<'tcx>,
options: TransformTyOptions,
) -> Instance<'tcx> {
// FIXME: account for async-drop-glue
if (matches!(instance.def, ty::InstanceKind::Virtual(..))
&& tcx.is_lang_item(instance.def_id(), LangItem::DropInPlace))
|| matches!(instance.def, ty::InstanceKind::DropGlue(..))