@@ -3,9 +3,9 @@ use crate::{ImplTraitContext, ImplTraitPosition, ParamMode, ResolverAstLoweringE
3
3
use super :: errors:: {
4
4
AbiSpecifiedMultipleTimes , AttSyntaxOnlyX86 , ClobberAbiNotSupported ,
5
5
InlineAsmUnsupportedTarget , InvalidAbiClobberAbi , InvalidAsmTemplateModifierConst ,
6
- InvalidAsmTemplateModifierRegClass , InvalidAsmTemplateModifierRegClassSub ,
7
- InvalidAsmTemplateModifierSym , InvalidRegister , InvalidRegisterClass , RegisterClassOnlyClobber ,
8
- RegisterConflict ,
6
+ InvalidAsmTemplateModifierLabel , InvalidAsmTemplateModifierRegClass ,
7
+ InvalidAsmTemplateModifierRegClassSub , InvalidAsmTemplateModifierSym , InvalidRegister ,
8
+ InvalidRegisterClass , RegisterClassOnlyClobber , RegisterConflict ,
9
9
} ;
10
10
use super :: LoweringContext ;
11
11
@@ -241,6 +241,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
241
241
}
242
242
}
243
243
}
244
+ InlineAsmOperand :: Label { block } => {
245
+ if !self . tcx . features ( ) . asm_goto {
246
+ feature_err (
247
+ & sess. parse_sess ,
248
+ sym:: asm_goto,
249
+ * op_sp,
250
+ "label operands for inline assembly are unstable" ,
251
+ )
252
+ . emit ( ) ;
253
+ }
254
+ hir:: InlineAsmOperand :: Label { block : self . lower_block ( block, false ) }
255
+ }
244
256
} ;
245
257
( op, self . lower_span ( * op_sp) )
246
258
} )
@@ -300,6 +312,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
300
312
op_span : op_sp,
301
313
} ) ;
302
314
}
315
+ hir:: InlineAsmOperand :: Label { .. } => {
316
+ self . dcx ( ) . emit_err ( InvalidAsmTemplateModifierLabel {
317
+ placeholder_span,
318
+ op_span : op_sp,
319
+ } ) ;
320
+ }
303
321
}
304
322
}
305
323
}
@@ -339,7 +357,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
339
357
340
358
hir:: InlineAsmOperand :: Const { .. }
341
359
| hir:: InlineAsmOperand :: SymFn { .. }
342
- | hir:: InlineAsmOperand :: SymStatic { .. } => {
360
+ | hir:: InlineAsmOperand :: SymStatic { .. }
361
+ | hir:: InlineAsmOperand :: Label { .. } => {
343
362
unreachable ! ( "{op:?} is not a register operand" ) ;
344
363
}
345
364
} ;
0 commit comments