From 64fbdc37799b44a85a2dd6cb491ee96e6931cb5d Mon Sep 17 00:00:00 2001 From: lcnr Date: Fri, 14 Apr 2023 15:44:05 +0200 Subject: [PATCH] explicit adt_dtorck_constraint for ManuallyDrop --- compiler/rustc_traits/src/dropck_outlives.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_traits/src/dropck_outlives.rs b/compiler/rustc_traits/src/dropck_outlives.rs index b5924e949146b..58117c46f0430 100644 --- a/compiler/rustc_traits/src/dropck_outlives.rs +++ b/compiler/rustc_traits/src/dropck_outlives.rs @@ -292,7 +292,9 @@ pub(crate) fn adt_dtorck_constraint( let span = tcx.def_span(def_id); debug!("dtorck_constraint: {:?}", def); - if def.is_phantom_data() { + if def.is_manually_drop() { + bug!("`ManuallyDrop` should have been handled by `trivial_dropck_outlives`"); + } else if def.is_phantom_data() { // The first generic parameter here is guaranteed to be a type because it's // `PhantomData`. let substs = InternalSubsts::identity_for_item(tcx, def_id);