1
Fork 0

Remove unnamed field feature

This commit is contained in:
Michael Goulet 2024-09-29 22:10:16 -04:00
parent 8dd5cd0bc1
commit e3a0da1863
40 changed files with 30 additions and 3209 deletions

View file

@ -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();