about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-23 02:05:13 +0000
committerbors <bors@rust-lang.org>2025-02-23 02:05:13 +0000
commitbca5f37cbded0db8d37414bb08c4b101a5f26d36 (patch)
tree9da15a1319e4c1692afd6b59bed28ee35339be7b /compiler/rustc_codegen_ssa/src
parent07697360aee0cebcb4e304236ba1884d8dde5469 (diff)
parente780b89959c7bfd7ab5a860f517209535884a39d (diff)
downloadrust-bca5f37cbded0db8d37414bb08c4b101a5f26d36.tar.gz
rust-bca5f37cbded0db8d37414bb08c4b101a5f26d36.zip
Auto merge of #137446 - matthiaskrgr:rollup-16moy6v, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private)
 - #137121 (stabilize `(const_)ptr_sub_ptr`)
 - #137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes)
 - #137256 (compiler: untangle SIMD alignment assumptions)
 - #137383 (stabilize `unsigned_is_multiple_of`)
 - #137415 (Remove invalid suggestion of into_iter for extern macro)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mono_item.rs9
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 5f95b6615bd..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"),