Skip to content

Commit b082560

Browse files
committed
global_asm gains a fake body
1 parent 07b8812 commit b082560

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/monomorphize_collector.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,16 @@ fn collect_items_rec<'tcx>(
283283
recursion_depth_reset = None;
284284

285285
let item = tcx.hir_item(item_id);
286-
if let hir::ItemKind::GlobalAsm(asm) = item.kind {
286+
if let hir::ItemKind::GlobalAsm { asm, .. } = item.kind {
287287
for (op, op_sp) in asm.operands {
288288
match op {
289289
hir::InlineAsmOperand::Const { .. } => {
290290
// Only constants which resolve to a plain integer
291291
// are supported. Therefore the value should not
292292
// depend on any other items.
293293
}
294-
hir::InlineAsmOperand::SymFn { anon_const } => {
295-
let fn_ty = tcx
296-
.typeck_body(anon_const.body)
297-
.node_type(anon_const.hir_id);
294+
hir::InlineAsmOperand::SymFn { expr } => {
295+
let fn_ty = tcx.typeck(item_id.owner_id).expr_ty(expr);
298296
visit_fn_use(tcx, fn_ty, false, *op_sp, &mut used_items);
299297
}
300298
hir::InlineAsmOperand::SymStatic { path: _, def_id } => {

0 commit comments

Comments
 (0)