Driveby fixes

This commit is contained in:
Boxy
2025-08-22 12:31:34 +01:00
committed by lcnr
parent e379c77586
commit 332d8d6235
6 changed files with 9 additions and 10 deletions

View File

@@ -350,6 +350,8 @@ pub fn dtorck_constraint_for_ty_inner<'tcx>(
// Note that we don't care about whether the resume type has any drops since this is
// redundant; there is no storage for the resume type, so if it is actually stored
// in the interior, we'll already detect the need for a drop by checking the interior.
//
// FIXME(@lcnr): Why do we erase regions in the env here? Seems odd
let typing_env = tcx.erase_and_anonymize_regions(typing_env);
let needs_drop = tcx.mir_coroutine_witnesses(def_id).is_some_and(|witness| {
witness.field_tys.iter().any(|field| field.ty.needs_drop(tcx, typing_env))