Skip to content

Commit 921efd2

Browse files
Add missing normalization for union fields types
1 parent 5376670 commit 921efd2

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_hir_analysis/src/check

1 file changed

+1
-1
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> b
121121

122122
let param_env = tcx.param_env(item_def_id);
123123
for field in &def.non_enum_variant().fields {
124-
let field_ty = field.ty(tcx, substs);
124+
let field_ty = tcx.normalize_erasing_regions(param_env, field.ty(tcx, substs));
125125

126126
if !allowed_union_field(field_ty, tcx, param_env) {
127127
let (field_span, ty_span) = match tcx.hir().get_if_local(field.did) {

0 commit comments

Comments
 (0)