From a74eba4ad56fe3138a23c471ad00d0e906bc3809 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Fri, 23 Sep 2022 18:07:36 +0000 Subject: [PATCH] Make `ManuallyDrop` satisfy `~const Destruct` --- .../rustc_trait_selection/src/traits/select/confirmation.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index e08f03a270c..27fbfb6dd21 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -1224,6 +1224,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { | ty::Never | ty::Foreign(_) => {} + // `ManuallyDrop` is trivially drop + ty::Adt(def, _) if Some(def.did()) == tcx.lang_items().manually_drop() => {} + // These types are built-in, so we can fast-track by registering // nested predicates for their constituent type(s) ty::Array(ty, _) | ty::Slice(ty) => {