From 47444d7c2559f4a82ec2d5ca65d86ad795e48aef Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sat, 20 May 2023 17:54:31 -0400 Subject: [PATCH] improve code checking for drop_in_place lang item --- compiler/rustc_ty_utils/src/abi.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index 5bfb48cb5e00..b7d4d90f1093 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -375,10 +375,8 @@ fn fn_abi_new_uncached<'tcx>( use SpecAbi::*; let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall); - let is_drop_in_place = match (cx.tcx.lang_items().drop_in_place_fn(), fn_def_id) { - (Some(drop_in_place_fn), Some(fn_def_id)) => drop_in_place_fn == fn_def_id, - _ => false, - }; + let is_drop_in_place = + fn_def_id.is_some() && fn_def_id == cx.tcx.lang_items().drop_in_place_fn(); let arg_of = |ty: Ty<'tcx>, arg_idx: Option| -> Result<_, FnAbiError<'tcx>> { let span = tracing::debug_span!("arg_of");