]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_monomorphize/src/collector.rs
Collect function instance used in `global_asm!` sym operand
[rust.git] / compiler / rustc_monomorphize / src / collector.rs
index 1828aecb375c4fdcc9943cb5542e8908f7adf104..18f32b04fadca5aee2e066896992cefbd1986066 100644 (file)
@@ -445,12 +445,9 @@ fn collect_items_rec<'tcx>(
                             // depend on any other items.
                         }
                         hir::InlineAsmOperand::SymFn { anon_const } => {
-                            let def_id = tcx.hir().body_owner_def_id(anon_const.body).to_def_id();
-                            if let Ok(val) = tcx.const_eval_poly(def_id) {
-                                rustc_data_structures::stack::ensure_sufficient_stack(|| {
-                                    collect_const_value(tcx, val, &mut neighbors);
-                                });
-                            }
+                            let fn_ty =
+                                tcx.typeck_body(anon_const.body).node_type(anon_const.hir_id);
+                            visit_fn_use(tcx, fn_ty, false, *op_sp, &mut neighbors);
                         }
                         hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
                             let instance = Instance::mono(tcx, *def_id);