Skip to content

Commit

Permalink
global_asm gains a fake body
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Feb 24, 2025
1 parent 07b8812 commit b082560
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/monomorphize_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,16 @@ fn collect_items_rec<'tcx>(
recursion_depth_reset = None;

let item = tcx.hir_item(item_id);
if let hir::ItemKind::GlobalAsm(asm) = item.kind {
if let hir::ItemKind::GlobalAsm { asm, .. } = item.kind {
for (op, op_sp) in asm.operands {
match op {
hir::InlineAsmOperand::Const { .. } => {
// Only constants which resolve to a plain integer
// are supported. Therefore the value should not
// depend on any other items.
}
hir::InlineAsmOperand::SymFn { anon_const } => {
let fn_ty = tcx
.typeck_body(anon_const.body)
.node_type(anon_const.hir_id);
hir::InlineAsmOperand::SymFn { expr } => {
let fn_ty = tcx.typeck(item_id.owner_id).expr_ty(expr);
visit_fn_use(tcx, fn_ty, false, *op_sp, &mut used_items);
}
hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
Expand Down

0 comments on commit b082560

Please sign in to comment.