Skip to content

Commit 7636e07

Browse files
committed
Try field type normalization instead of forcing it
1 parent 5c6760f commit 7636e07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_mir_dataflow/src/value_analysis.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ fn iter_fields<'tcx>(
589589
ty::Adt(def, substs) => {
590590
for (v_index, v_def) in def.variants().iter_enumerated() {
591591
for (f_index, f_def) in v_def.fields.iter().enumerate() {
592-
let field_ty = tcx.normalize_erasing_regions(
593-
ty::ParamEnv::reveal_all(),
594-
f_def.ty(tcx, substs),
595-
);
592+
let field_ty = f_def.ty(tcx, substs);
593+
let field_ty = tcx
594+
.try_normalize_erasing_regions(ty::ParamEnv::reveal_all(), field_ty)
595+
.unwrap_or(field_ty);
596596
f(Some(v_index), f_index.into(), field_ty);
597597
}
598598
}

0 commit comments

Comments
 (0)