diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-17 16:09:46 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-22 00:12:07 +0000 |
| commit | 6ba39f7dc709a90bcb125974964a7e464ed86ff2 (patch) | |
| tree | 68d6c9515988454516ca2373683f87d01b890c9f /compiler/rustc_codegen_ssa/src | |
| parent | 37060aae13d0fe771f9d3222f1c644820a9d2837 (diff) | |
| download | rust-6ba39f7dc709a90bcb125974964a7e464ed86ff2.tar.gz rust-6ba39f7dc709a90bcb125974964a7e464ed86ff2.zip | |
Make a fake body to store typeck results for global_asm
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mono_item.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs index a4d5f8bb701..f6af889fd6e 100644 --- a/compiler/rustc_codegen_ssa/src/mono_item.rs +++ b/compiler/rustc_codegen_ssa/src/mono_item.rs @@ -36,7 +36,7 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { } MonoItem::GlobalAsm(item_id) => { let item = cx.tcx().hir_item(item_id); - if let hir::ItemKind::GlobalAsm { asm } = item.kind { + if let hir::ItemKind::GlobalAsm { asm, .. } = item.kind { let operands: Vec<_> = asm .operands .iter() @@ -71,11 +71,8 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { } } } - hir::InlineAsmOperand::SymFn { ref anon_const } => { - let ty = cx - .tcx() - .typeck_body(anon_const.body) - .node_type(anon_const.hir_id); + hir::InlineAsmOperand::SymFn { expr } => { + let ty = cx.tcx().typeck(item_id.owner_id).expr_ty(expr); let instance = match ty.kind() { &ty::FnDef(def_id, args) => Instance::new(def_id, args), _ => span_bug!(*op_sp, "asm sym is not a function"), |
