diff options
| author | b-naber <bn263@gmx.de> | 2022-09-14 15:35:24 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-09-14 17:30:25 +0200 |
| commit | 6af8fb793697734bf3e19bcb1b5d152d617bb303 (patch) | |
| tree | ce28e3c0abc38368fba67c76de230c3c54a7792c /compiler/rustc_codegen_cranelift/src | |
| parent | ba00189d8e85b735d90144f9523b8a1dad2ccdce (diff) | |
| download | rust-6af8fb793697734bf3e19bcb1b5d152d617bb303.tar.gz rust-6af8fb793697734bf3e19bcb1b5d152d617bb303.zip | |
address review again
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/constant.rs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs index a04b38ae33f..bc34802fa72 100644 --- a/compiler/rustc_codegen_cranelift/src/constant.rs +++ b/compiler/rustc_codegen_cranelift/src/constant.rs @@ -121,25 +121,7 @@ pub(crate) fn codegen_constant<'tcx>( ConstKind::Value(valtree) => { (fx.tcx.valtree_to_const_val((const_.ty(), valtree)), const_.ty()) } - ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }) - if fx.tcx.is_static(def.did) => - { - assert!(substs.is_empty()); - assert_eq!(promoted, ()); - return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty())).to_cvalue(fx); - } - ConstKind::Unevaluated(unevaluated) => { - match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated.expand(), None) - { - Ok(const_val) => (const_val, const_.ty()), - Err(_) => { - span_bug!( - constant.span, - "erroneous constant not captured by required_consts" - ); - } - } - } + ConstKind::Unevaluated(_) => bug!("expected constant to be evaluated at this stage"), ConstKind::Param(_) | ConstKind::Infer(_) | ConstKind::Bound(_, _) |
