diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-06 19:17:57 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-13 14:06:11 +0000 |
| commit | 607d0c2a14c4f5f6c7341f8879c9bc80414f5080 (patch) | |
| tree | 3c211e2115359243fbdcfa2f5e69a4cb0263a43d /compiler/rustc_codegen_ssa/src | |
| parent | 18482f7b2341fcabdbb854e3d4fe9a724726aa97 (diff) | |
| download | rust-607d0c2a14c4f5f6c7341f8879c9bc80414f5080.tar.gz rust-607d0c2a14c4f5f6c7341f8879c9bc80414f5080.zip | |
Store a LocalDefId in hir::AnonConst.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mono_item.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs index 5006a2157fc..27da33581a1 100644 --- a/compiler/rustc_codegen_ssa/src/mono_item.rs +++ b/compiler/rustc_codegen_ssa/src/mono_item.rs @@ -40,12 +40,12 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { .iter() .map(|(op, op_sp)| match *op { hir::InlineAsmOperand::Const { ref anon_const } => { - let anon_const_def_id = - cx.tcx().hir().local_def_id(anon_const.hir_id).to_def_id(); - let const_value = - cx.tcx().const_eval_poly(anon_const_def_id).unwrap_or_else( - |_| span_bug!(*op_sp, "asm const cannot be resolved"), - ); + let const_value = cx + .tcx() + .const_eval_poly(anon_const.def_id.to_def_id()) + .unwrap_or_else(|_| { + span_bug!(*op_sp, "asm const cannot be resolved") + }); let ty = cx .tcx() .typeck_body(anon_const.body) |
