From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_ast_lowering/src/asm.rs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'compiler/rustc_ast_lowering/src/asm.rs') diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs index 24672efc6..450cdf246 100644 --- a/compiler/rustc_ast_lowering/src/asm.rs +++ b/compiler/rustc_ast_lowering/src/asm.rs @@ -192,26 +192,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } } InlineAsmOperand::Sym { ref sym } => { - if !self.tcx.features().asm_sym { - feature_err( - &sess.parse_sess, - sym::asm_sym, - *op_sp, - "sym operands for inline assembly are unstable", - ) - .emit(); - } - let static_def_id = self .resolver .get_partial_res(sym.id) - .filter(|res| res.unresolved_segments() == 0) - .and_then(|res| { - if let Res::Def(DefKind::Static(_), def_id) = res.base_res() { - Some(def_id) - } else { - None - } + .and_then(|res| res.full_res()) + .and_then(|res| match res { + Res::Def(DefKind::Static(_), def_id) => Some(def_id), + _ => None, }); if let Some(def_id) = static_def_id { @@ -237,7 +224,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // Wrap the expression in an AnonConst. let parent_def_id = self.current_hir_id_owner; let node_id = self.next_node_id(); - self.create_def(parent_def_id, node_id, DefPathData::AnonConst); + self.create_def(parent_def_id.def_id, node_id, DefPathData::AnonConst); let anon_const = AnonConst { id: node_id, value: P(expr) }; hir::InlineAsmOperand::SymFn { anon_const: self.lower_anon_const(&anon_const), -- cgit v1.2.3