about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/constant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/constant.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/constant.rs20
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(_, _)