File tree 1 file changed +1
-19
lines changed
1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -121,25 +121,7 @@ pub(crate) fn codegen_constant<'tcx>(
121
121
ConstKind :: Value ( valtree) => {
122
122
( fx. tcx . valtree_to_const_val ( ( const_. ty ( ) , valtree) ) , const_. ty ( ) )
123
123
}
124
- ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
125
- if fx. tcx . is_static ( def. did ) =>
126
- {
127
- assert ! ( substs. is_empty( ) ) ;
128
- assert_eq ! ( promoted, ( ) ) ;
129
- return codegen_static_ref ( fx, def. did , fx. layout_of ( const_. ty ( ) ) ) . to_cvalue ( fx) ;
130
- }
131
- ConstKind :: Unevaluated ( unevaluated) => {
132
- match fx. tcx . const_eval_resolve ( ParamEnv :: reveal_all ( ) , unevaluated. expand ( ) , None )
133
- {
134
- Ok ( const_val) => ( const_val, const_. ty ( ) ) ,
135
- Err ( _) => {
136
- span_bug ! (
137
- constant. span,
138
- "erroneous constant not captured by required_consts"
139
- ) ;
140
- }
141
- }
142
- }
124
+ ConstKind :: Unevaluated ( _) => bug ! ( "expected constant to be evaluated at this stage" ) ,
143
125
ConstKind :: Param ( _)
144
126
| ConstKind :: Infer ( _)
145
127
| ConstKind :: Bound ( _, _)
You can’t perform that action at this time.
0 commit comments