Skip to content

Commit 47444d7

Browse files
improve code checking for drop_in_place lang item
1 parent 58c3999 commit 47444d7

File tree

1 file changed

+2
-4
lines changed
  • compiler/rustc_ty_utils/src

1 file changed

+2
-4
lines changed

compiler/rustc_ty_utils/src/abi.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,8 @@ fn fn_abi_new_uncached<'tcx>(
375375
use SpecAbi::*;
376376
let rust_abi = matches!(sig.abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall);
377377

378-
let is_drop_in_place = match (cx.tcx.lang_items().drop_in_place_fn(), fn_def_id) {
379-
(Some(drop_in_place_fn), Some(fn_def_id)) => drop_in_place_fn == fn_def_id,
380-
_ => false,
381-
};
378+
let is_drop_in_place =
379+
fn_def_id.is_some() && fn_def_id == cx.tcx.lang_items().drop_in_place_fn();
382380

383381
let arg_of = |ty: Ty<'tcx>, arg_idx: Option<usize>| -> Result<_, FnAbiError<'tcx>> {
384382
let span = tracing::debug_span!("arg_of");

0 commit comments

Comments
 (0)