@@ -5,7 +5,6 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
5
5
use rustc_middle:: mir:: interpret:: {
6
6
read_target_uint, AllocId , ConstAllocation , ConstValue , ErrorHandled , GlobalAlloc , Scalar ,
7
7
} ;
8
- use rustc_middle:: ty:: ConstKind ;
9
8
use rustc_span:: DUMMY_SP ;
10
9
11
10
use cranelift_codegen:: ir:: GlobalValueData ;
@@ -42,15 +41,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
42
41
let mut all_constants_ok = true ;
43
42
for constant in & fx. mir . required_consts {
44
43
let unevaluated = match fx. monomorphize ( constant. literal ) {
45
- ConstantKind :: Ty ( ct) => match ct. kind ( ) {
46
- ConstKind :: Unevaluated ( uv) => uv. expand ( ) ,
47
- ConstKind :: Value ( _) => continue ,
48
- ConstKind :: Param ( _)
49
- | ConstKind :: Infer ( _)
50
- | ConstKind :: Bound ( _, _)
51
- | ConstKind :: Placeholder ( _)
52
- | ConstKind :: Error ( _) => unreachable ! ( "{:?}" , ct) ,
53
- } ,
44
+ ConstantKind :: Ty ( _) => unreachable ! ( ) ,
54
45
ConstantKind :: Unevaluated ( uv, _) => uv,
55
46
ConstantKind :: Val ( ..) => continue ,
56
47
} ;
@@ -118,7 +109,7 @@ pub(crate) fn codegen_constant<'tcx>(
118
109
) -> CValue < ' tcx > {
119
110
let ( const_val, ty) = match fx. monomorphize ( constant. literal ) {
120
111
ConstantKind :: Ty ( const_) => unreachable ! ( "{:?}" , const_) ,
121
- ConstantKind :: Unevaluated ( ty :: Unevaluated { def, substs, promoted } , ty)
112
+ ConstantKind :: Unevaluated ( mir :: Unevaluated { def, substs, promoted } , ty)
122
113
if fx. tcx . is_static ( def. did ) =>
123
114
{
124
115
assert ! ( substs. is_empty( ) ) ;
0 commit comments