File tree 1 file changed +13
-4
lines changed
compiler/rustc_monomorphize/src
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -482,10 +482,19 @@ fn collect_items_rec<'tcx>(
482
482
if let hir:: ItemKind :: GlobalAsm { asm, .. } = item. kind {
483
483
for ( op, op_sp) in asm. operands {
484
484
match * op {
485
- hir:: InlineAsmOperand :: Const { .. } => {
486
- // Only constants which resolve to a plain integer
487
- // are supported. Therefore the value should not
488
- // depend on any other items.
485
+ hir:: InlineAsmOperand :: Const { anon_const } => {
486
+ match tcx. const_eval_poly ( anon_const. def_id . to_def_id ( ) ) {
487
+ Ok ( val) => {
488
+ collect_const_value ( tcx, val, & mut used_items) ;
489
+ }
490
+ Err ( ErrorHandled :: TooGeneric ( ..) ) => {
491
+ span_bug ! ( * op_sp, "asm const cannot be resolved; too generic" )
492
+ }
493
+ Err ( err @ ErrorHandled :: Reported ( ..) ) => {
494
+ err. emit_note ( tcx) ;
495
+ continue ;
496
+ }
497
+ }
489
498
}
490
499
hir:: InlineAsmOperand :: SymFn { expr } => {
491
500
let fn_ty = tcx. typeck ( item_id. owner_id ) . expr_ty ( expr) ;
You can’t perform that action at this time.
0 commit comments