about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/thir
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-29 22:10:16 -0400
committerMichael Goulet <michael@errs.io>2024-10-01 13:55:46 -0400
commite3a0da18633a8cfb5263bb975747352690b01fcf (patch)
treee5f9850e4d0a47a6d7178469cea7f53bac319d20 /compiler/rustc_mir_build/src/thir
parent8dd5cd0bc1d683c30805e1dc831cac546b621a75 (diff)
downloadrust-e3a0da18633a8cfb5263bb975747352690b01fcf.tar.gz
rust-e3a0da18633a8cfb5263bb975747352690b01fcf.zip
Remove unnamed field feature
Diffstat (limited to 'compiler/rustc_mir_build/src/thir')
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/expr.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
index 2ffad0b4834..044d8045a27 100644
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
@@ -807,21 +807,11 @@ impl<'tcx> Cx<'tcx> {
                 });
                 ExprKind::Loop { body }
             }
-            hir::ExprKind::Field(source, ..) => {
-                let mut kind = ExprKind::Field {
-                    lhs: self.mirror_expr(source),
-                    variant_index: FIRST_VARIANT,
-                    name: self.typeck_results.field_index(expr.hir_id),
-                };
-                let nested_field_tys_and_indices =
-                    self.typeck_results.nested_field_tys_and_indices(expr.hir_id);
-                for &(ty, idx) in nested_field_tys_and_indices {
-                    let expr = Expr { temp_lifetime, ty, span: source.span, kind };
-                    let lhs = self.thir.exprs.push(expr);
-                    kind = ExprKind::Field { lhs, variant_index: FIRST_VARIANT, name: idx };
-                }
-                kind
-            }
+            hir::ExprKind::Field(source, ..) => ExprKind::Field {
+                lhs: self.mirror_expr(source),
+                variant_index: FIRST_VARIANT,
+                name: self.typeck_results.field_index(expr.hir_id),
+            },
             hir::ExprKind::Cast(source, cast_ty) => {
                 // Check for a user-given type annotation on this `cast`
                 let user_provided_types = self.typeck_results.user_provided_types();