File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
compiler/rustc_monomorphize/src Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -508,10 +508,18 @@ fn collect_items_rec<'tcx>(
508508 if let hir:: ItemKind :: GlobalAsm { asm, .. } = item. kind {
509509 for ( op, op_sp) in asm. operands {
510510 match * op {
511- hir:: InlineAsmOperand :: Const { .. } => {
512- // Only constants which resolve to a plain integer
513- // are supported. Therefore the value should not
514- // depend on any other items.
511+ hir:: InlineAsmOperand :: Const { anon_const } => {
512+ match tcx. const_eval_poly ( anon_const. def_id . to_def_id ( ) ) {
513+ Ok ( val) => {
514+ collect_const_value ( tcx, val, & mut used_items) ;
515+ }
516+ Err ( ErrorHandled :: TooGeneric ( ..) ) => {
517+ span_bug ! ( * op_sp, "asm const cannot be resolved; too generic" )
518+ }
519+ Err ( ErrorHandled :: Reported ( ..) ) => {
520+ continue ;
521+ }
522+ }
515523 }
516524 hir:: InlineAsmOperand :: SymFn { expr } => {
517525 let fn_ty = tcx. typeck ( item_id. owner_id ) . expr_ty ( expr) ;
You can’t perform that action at this time.
0 commit comments