diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-14 14:46:32 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-06-14 16:54:29 -0400 |
| commit | 93ff86ed7c38b68644964d80155cff5e04bd5f42 (patch) | |
| tree | 62291a4907bd3ea5a4d9705f27cb62cd44379a91 /compiler/rustc_codegen_cranelift/src | |
| parent | d5c48ebc71280cb523b23f9be25ef8a66916e75d (diff) | |
| download | rust-93ff86ed7c38b68644964d80155cff5e04bd5f42.tar.gz rust-93ff86ed7c38b68644964d80155cff5e04bd5f42.zip | |
Use is_lang_item more aggressively
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/inline_asm.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs index 2de804f5e04..c6b26dd873b 100644 --- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs +++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs @@ -4,6 +4,7 @@ use std::fmt::Write; use cranelift_codegen::isa::CallConv; use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; +use rustc_hir::LangItem; use rustc_span::sym; use rustc_target::asm::*; use target_lexicon::BinaryFormat; @@ -927,7 +928,7 @@ fn call_inline_asm<'tcx>( fn asm_clif_type<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> Option<types::Type> { match ty.kind() { // Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc_hir_analysis/src/check/intrinsicck.rs#L136-L151 - ty::Adt(adt, args) if Some(adt.did()) == fx.tcx.lang_items().maybe_uninit() => { + ty::Adt(adt, args) if fx.tcx.is_lang_item(adt.did(), LangItem::MaybeUninit) => { let fields = &adt.non_enum_variant().fields; let ty = fields[FieldIdx::from_u32(1)].ty(fx.tcx, args); let ty::Adt(ty, args) = ty.kind() else { |
