about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-01 05:03:30 +0000
committerbors <bors@rust-lang.org>2025-03-01 05:03:30 +0000
commit002da76821d32c8807dc47da16660925d8cc9b62 (patch)
treef2ffc96c2e39855bf8305a0f4d6dcb3bd38153b4 /compiler/rustc_resolve/src
parent30508faeb3248d399079513b6e0107af30a43948 (diff)
parente5a639dbd020f9f76b799c15e1343f3d26f5b2cf (diff)
downloadrust-002da76821d32c8807dc47da16660925d8cc9b62.tar.gz
rust-002da76821d32c8807dc47da16660925d8cc9b62.zip
Auto merge of #137838 - matthiaskrgr:rollup-5brlcyr, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #137045 (Defer repeat expr `Copy` checks to end of type checking)
 - #137171 (Suggest swapping equality on E0277)
 - #137686 (Handle asm const similar to inline const)
 - #137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.)
 - #137718 (Use original command for showing sccache stats)
 - #137730 (checked_ilog tests: deal with a bit of float imprecision)
 - #137735 (Update E0133 docs for 2024 edition)
 - #137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
 - #137771 (Tweak incorrect ABI suggestion and make suggestion verbose)

Failed merges:

 - #137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/def_collector.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs
index 75972a71c8e..9d78c71b76a 100644
--- a/compiler/rustc_resolve/src/def_collector.rs
+++ b/compiler/rustc_resolve/src/def_collector.rs
@@ -459,4 +459,43 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
         visit::walk_attribute(self, attr);
         self.in_attr = orig_in_attr;
     }
+
+    fn visit_inline_asm(&mut self, asm: &'a InlineAsm) {
+        let InlineAsm {
+            asm_macro: _,
+            template: _,
+            template_strs: _,
+            operands,
+            clobber_abis: _,
+            options: _,
+            line_spans: _,
+        } = asm;
+        for (op, _span) in operands {
+            match op {
+                InlineAsmOperand::In { expr, reg: _ }
+                | InlineAsmOperand::Out { expr: Some(expr), reg: _, late: _ }
+                | InlineAsmOperand::InOut { expr, reg: _, late: _ } => {
+                    self.visit_expr(expr);
+                }
+                InlineAsmOperand::Out { expr: None, reg: _, late: _ } => {}
+                InlineAsmOperand::SplitInOut { in_expr, out_expr, reg: _, late: _ } => {
+                    self.visit_expr(in_expr);
+                    if let Some(expr) = out_expr {
+                        self.visit_expr(expr);
+                    }
+                }
+                InlineAsmOperand::Const { anon_const } => {
+                    let def = self.create_def(
+                        anon_const.id,
+                        kw::Empty,
+                        DefKind::InlineConst,
+                        anon_const.value.span,
+                    );
+                    self.with_parent(def, |this| visit::walk_anon_const(this, anon_const));
+                }
+                InlineAsmOperand::Sym { sym } => self.visit_inline_asm_sym(sym),
+                InlineAsmOperand::Label { block } => self.visit_block(block),
+            }
+        }
+    }
 }