File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
rustc_hir_typeck/src/fn_ctxt Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ impl<'tcx> HirTyLowerer<'tcx> for ItemCtxt<'tcx> {
410410 }
411411
412412 field_indices. push ( ( FIRST_VARIANT , index) ) ;
413- if !last {
413+ if field_path_kind == FieldPathKind :: OffsetOf || !last {
414414 let field_ty = field. ty ( self . tcx , args) ;
415415 current_container = field_ty;
416416 }
Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
362362 self . private_field_err ( ident, container_def. did ( ) ) . emit ( ) ;
363363 }
364364
365- if !last {
365+ if field_path_kind == FieldPathKind :: OffsetOf || !last {
366366 let field_ty = self . field_ty ( span, field, args) ;
367367
368368 // Enums are anyway always sized. But just to safeguard against future
@@ -402,7 +402,7 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
402402 self . private_field_err ( ident, container_def. did ( ) ) . emit ( ) ;
403403 }
404404
405- if !last {
405+ if field_path_kind == FieldPathKind :: OffsetOf || !last {
406406 let field_ty = self . field_ty ( span, field, args) ;
407407
408408 match field_path_kind {
You can’t perform that action at this time.
0 commit comments