diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-04-26 20:27:27 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-05-13 22:31:58 +0100 |
| commit | 40d9da4d8c9cad8cd78a3fcc47f40cb9335a07d7 (patch) | |
| tree | b0375a11da3088d7ea6a0267933289a16a65d49a | |
| parent | bb6bec1d55586abfb6aa6ca924994b09035752dc (diff) | |
| download | rust-40d9da4d8c9cad8cd78a3fcc47f40cb9335a07d7.tar.gz rust-40d9da4d8c9cad8cd78a3fcc47f40cb9335a07d7.zip | |
global_asm! consts do not depend on other items
| -rw-r--r-- | compiler/rustc_mir/src/monomorphize/collector.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_mir/src/monomorphize/collector.rs b/compiler/rustc_mir/src/monomorphize/collector.rs index c0d327d4788..e4ad92eb1b1 100644 --- a/compiler/rustc_mir/src/monomorphize/collector.rs +++ b/compiler/rustc_mir/src/monomorphize/collector.rs @@ -397,13 +397,10 @@ fn collect_items_rec<'tcx>( if let hir::ItemKind::GlobalAsm(asm) = item.kind { for (op, op_sp) in asm.operands { match op { - hir::InlineAsmOperand::Const { ref anon_const } => { - // Treat these the same way as ItemKind::Const - let anon_const_def_id = - tcx.hir().local_def_id(anon_const.hir_id).to_def_id(); - if let Ok(val) = tcx.const_eval_poly(anon_const_def_id) { - collect_const_value(tcx, val, &mut neighbors); - } + hir::InlineAsmOperand::Const { .. } => { + // Only constants which resolve to a plain integer + // are supported. Therefore the value should not + // depend on any other items. } _ => span_bug!(*op_sp, "invalid operand type for global_asm!"), } |
