@@ -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
@@ -236,6 +236,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
236236 }
237237 }
238238 }
239+ InlineAsmOperand :: Label { block } => {
240+ if !self . tcx . features ( ) . asm_goto {
241+ feature_err (
242+ sess,
243+ sym:: asm_goto,
244+ * op_sp,
245+ "label operands for inline assembly are unstable" ,
246+ )
247+ . emit ( ) ;
248+ }
249+ hir:: InlineAsmOperand :: Label { block : self . lower_block ( block, false ) }
250+ }
239251 } ;
240252 ( op, self . lower_span ( * op_sp) )
241253 } )
@@ -295,6 +307,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
295307 op_span : op_sp,
296308 } ) ;
297309 }
310+ hir:: InlineAsmOperand :: Label { .. } => {
311+ self . dcx ( ) . emit_err ( InvalidAsmTemplateModifierLabel {
312+ placeholder_span,
313+ op_span : op_sp,
314+ } ) ;
315+ }
298316 }
299317 }
300318 }
@@ -334,7 +352,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
334352
335353 hir:: InlineAsmOperand :: Const { .. }
336354 | hir:: InlineAsmOperand :: SymFn { .. }
337- | hir:: InlineAsmOperand :: SymStatic { .. } => {
355+ | hir:: InlineAsmOperand :: SymStatic { .. }
356+ | hir:: InlineAsmOperand :: Label { .. } => {
338357 unreachable ! ( "{op:?} is not a register operand" ) ;
339358 }
340359 } ;
0 commit comments