Skip to content

Commit c867677

Browse files
Use is_lang_item more aggressively
1 parent c7d3c4f commit c867677

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/inline_asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::fmt::Write;
44

55
use cranelift_codegen::isa::CallConv;
66
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
7+
use rustc_hir::LangItem;
78
use rustc_span::sym;
89
use rustc_target::asm::*;
910
use target_lexicon::BinaryFormat;
@@ -927,7 +928,7 @@ fn call_inline_asm<'tcx>(
927928
fn asm_clif_type<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> Option<types::Type> {
928929
match ty.kind() {
929930
// Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc_hir_analysis/src/check/intrinsicck.rs#L136-L151
930-
ty::Adt(adt, args) if Some(adt.did()) == fx.tcx.lang_items().maybe_uninit() => {
931+
ty::Adt(adt, args) if fx.tcx.is_lang_item(adt.did(), LangItem::MaybeUninit) => {
931932
let fields = &adt.non_enum_variant().fields;
932933
let ty = fields[FieldIdx::from_u32(1)].ty(fx.tcx, args);
933934
let ty::Adt(ty, args) = ty.kind() else {

0 commit comments

Comments
 (0)