about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-24 05:56:01 +0100
committerGitHub <noreply@github.com>2019-02-24 05:56:01 +0100
commit1082a292eafef01a24376b82be4dc875e595691e (patch)
treeea3bd28ec33ac99a8eef9a88489ae589d56e149e /src/librustc_codegen_llvm
parent4dcb7af0e71ea7c6790f225371a055ef707cf0cb (diff)
parent1fe7eb00944c3c41059e16daa7b401bc8b04447c (diff)
downloadrust-1082a292eafef01a24376b82be4dc875e595691e.tar.gz
rust-1082a292eafef01a24376b82be4dc875e595691e.zip
Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJung
Const to op simplification

r? @RalfJung

alternative to https://github.com/rust-lang/rust/pull/58486
Diffstat (limited to 'src/librustc_codegen_llvm')
-rw-r--r--src/librustc_codegen_llvm/consts.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs
index 6232d44df5e..4c88d4f0e63 100644
--- a/src/librustc_codegen_llvm/consts.rs
+++ b/src/librustc_codegen_llvm/consts.rs
@@ -71,7 +71,7 @@ pub fn codegen_static_initializer(
     let static_ = cx.tcx.const_eval(param_env.and(cid))?;
 
     let alloc = match static_.val {
-        ConstValue::ByRef(_, alloc, n) if n.bytes() == 0 => alloc,
+        ConstValue::ByRef(ptr, alloc) if ptr.offset.bytes() == 0 => alloc,
         _ => bug!("static const eval returned {:#?}", static_),
     };
     Ok((const_alloc_to_llvm(cx, alloc), alloc))