@@ -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
@@ -237,6 +237,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
237
237
}
238
238
}
239
239
}
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
+ }
240
252
} ;
241
253
( op, self . lower_span ( * op_sp) )
242
254
} )
@@ -296,6 +308,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
296
308
op_span : op_sp,
297
309
} ) ;
298
310
}
311
+ hir:: InlineAsmOperand :: Label { .. } => {
312
+ self . dcx ( ) . emit_err ( InvalidAsmTemplateModifierLabel {
313
+ placeholder_span,
314
+ op_span : op_sp,
315
+ } ) ;
316
+ }
299
317
}
300
318
}
301
319
}
@@ -335,7 +353,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
335
353
336
354
hir:: InlineAsmOperand :: Const { .. }
337
355
| hir:: InlineAsmOperand :: SymFn { .. }
338
- | hir:: InlineAsmOperand :: SymStatic { .. } => {
356
+ | hir:: InlineAsmOperand :: SymStatic { .. }
357
+ | hir:: InlineAsmOperand :: Label { .. } => {
339
358
unreachable ! ( "{op:?} is not a register operand" ) ;
340
359
}
341
360
} ;
0 commit comments