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
This commit is contained in:
commit
1082a292ea
15 changed files with 117 additions and 126 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue