diff options
| author | marmeladema <xademax@gmail.com> | 2020-04-23 20:48:40 +0100 |
|---|---|---|
| committer | marmeladema <xademax@gmail.com> | 2020-04-23 23:14:07 +0100 |
| commit | fe7531579d69a146fe71fd6efb9bde7167047473 (patch) | |
| tree | 13ecbc949adf3ecf3fcbb63c2a762fbc0df3a806 /src/librustc_codegen_llvm | |
| parent | bfce24aa675072c832e5160acdefc4e98b7fe8f3 (diff) | |
Address comments from review
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/consts.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs index c97b547946e..43ced8ee5b1 100644 --- a/src/librustc_codegen_llvm/consts.rs +++ b/src/librustc_codegen_llvm/consts.rs @@ -209,9 +209,8 @@ impl CodegenCx<'ll, 'tcx> { debug!("get_static: sym={} instance={:?}", sym, instance); - let g = if let Some(id) = - def_id.as_local().map(|def_id| self.tcx.hir().as_local_hir_id(def_id)) - { + let g = if let Some(def_id) = def_id.as_local() { + let id = self.tcx.hir().as_local_hir_id(def_id); let llty = self.layout_of(ty).llvm_type(self); let (g, attrs) = match self.tcx.hir().get(id) { Node::Item(&hir::Item { attrs, span, kind: hir::ItemKind::Static(..), .. }) => { |
