File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/librustc_mir/monomorphize Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -1265,11 +1265,12 @@ fn collect_const<'tcx>(
1265
1265
) {
1266
1266
debug ! ( "visiting const {:?}" , constant) ;
1267
1267
1268
- let substituted_constant = if let ConstValue :: Param ( param) = constant. val {
1269
- param_substs. const_at ( param. index as usize )
1270
- } else {
1271
- constant
1272
- } ;
1268
+ let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1269
+ let substituted_constant = tcx. subst_and_normalize_erasing_regions (
1270
+ param_substs,
1271
+ param_env,
1272
+ & constant,
1273
+ ) ;
1273
1274
1274
1275
match substituted_constant. val {
1275
1276
ConstValue :: Scalar ( Scalar :: Ptr ( ptr) ) =>
@@ -1281,12 +1282,6 @@ fn collect_const<'tcx>(
1281
1282
}
1282
1283
}
1283
1284
ConstValue :: Unevaluated ( def_id, substs) => {
1284
- let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1285
- let substs = tcx. subst_and_normalize_erasing_regions (
1286
- param_substs,
1287
- param_env,
1288
- & substs,
1289
- ) ;
1290
1285
let instance = ty:: Instance :: resolve ( tcx,
1291
1286
param_env,
1292
1287
def_id,
You can’t perform that action at this time.
0 commit comments