File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,13 @@ pub(crate) fn codegen_constant<'tcx>(
129129 } ;
130130 let const_val = match const_. val {
131131 ConstKind :: Value ( const_val) => const_val,
132- ConstKind :: Unevaluated ( uv) if fx. tcx . is_static ( uv. def . did ) => {
133- assert ! ( uv. substs( fx. tcx) . is_empty( ) ) ;
134- assert ! ( uv. promoted. is_none( ) ) ;
132+ ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
133+ if fx. tcx . is_static ( def. did ) =>
134+ {
135+ assert ! ( substs. is_empty( ) ) ;
136+ assert ! ( promoted. is_none( ) ) ;
135137
136- return codegen_static_ref ( fx, uv . def . did , fx. layout_of ( const_. ty ) ) . to_cvalue ( fx) ;
138+ return codegen_static_ref ( fx, def. did , fx. layout_of ( const_. ty ) ) . to_cvalue ( fx) ;
137139 }
138140 ConstKind :: Unevaluated ( unevaluated) => {
139141 match fx. tcx . const_eval_resolve ( ParamEnv :: reveal_all ( ) , unevaluated, None ) {
You can’t perform that action at this time.
0 commit comments