@@ -3,9 +3,9 @@ use crate::{ImplTraitContext, ImplTraitPosition, ParamMode, ResolverAstLoweringE
33use super :: errors:: {
44 AbiSpecifiedMultipleTimes , AttSyntaxOnlyX86 , ClobberAbiNotSupported ,
55 InlineAsmUnsupportedTarget , InvalidAbiClobberAbi , InvalidAsmTemplateModifierConst ,
6- InvalidAsmTemplateModifierRegClass , InvalidAsmTemplateModifierRegClassSub ,
7- InvalidAsmTemplateModifierSym , InvalidRegister , InvalidRegisterClass , RegisterClassOnlyClobber ,
8- RegisterConflict ,
6+ InvalidAsmTemplateModifierLabel , InvalidAsmTemplateModifierRegClass ,
7+ InvalidAsmTemplateModifierRegClassSub , InvalidAsmTemplateModifierSym , InvalidRegister ,
8+ InvalidRegisterClass , RegisterClassOnlyClobber , RegisterConflict ,
99} ;
1010use super :: LoweringContext ;
1111
@@ -237,6 +237,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
237237 }
238238 }
239239 }
240+ InlineAsmOperand :: Label { block } => {
241+ if !self . tcx . features ( ) . asm_goto {
242+ feature_err (
243+ sess,
244+ sym:: asm_goto,
245+ * op_sp,
246+ "label operands for inline assembly are unstable" ,
247+ )
248+ . emit ( ) ;
249+ }
250+ hir:: InlineAsmOperand :: Label { block : self . lower_block ( block, false ) }
251+ }
240252 } ;
241253 ( op, self . lower_span ( * op_sp) )
242254 } )
@@ -296,6 +308,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
296308 op_span : op_sp,
297309 } ) ;
298310 }
311+ hir:: InlineAsmOperand :: Label { .. } => {
312+ self . dcx ( ) . emit_err ( InvalidAsmTemplateModifierLabel {
313+ placeholder_span,
314+ op_span : op_sp,
315+ } ) ;
316+ }
299317 }
300318 }
301319 }
@@ -335,7 +353,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
335353
336354 hir:: InlineAsmOperand :: Const { .. }
337355 | hir:: InlineAsmOperand :: SymFn { .. }
338- | hir:: InlineAsmOperand :: SymStatic { .. } => {
356+ | hir:: InlineAsmOperand :: SymStatic { .. }
357+ | hir:: InlineAsmOperand :: Label { .. } => {
339358 unreachable ! ( "{op:?} is not a register operand" ) ;
340359 }
341360 } ;
0 commit comments