@@ -1264,46 +1264,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12641264 let kind = match & t. kind {
12651265 TyKind :: Infer => hir:: TyKind :: Infer ,
12661266 TyKind :: Err ( guar) => hir:: TyKind :: Err ( * guar) ,
1267- // Lower the anonymous structs or unions in a nested lowering context.
1268- //
1269- // ```
1270- // struct Foo {
1271- // _: union {
1272- // // ^__________________ <-- within the nested lowering context,
1273- // /* fields */ // | we lower all fields defined into an
1274- // } // | owner node of struct or union item
1275- // // ^_____________________|
1276- // }
1277- // ```
1278- TyKind :: AnonStruct ( node_id, fields) | TyKind :: AnonUnion ( node_id, fields) => {
1279- // Here its `def_id` is created in `build_reduced_graph`.
1280- let def_id = self . local_def_id ( * node_id) ;
1281- debug ! ( ?def_id) ;
1282- let owner_id = hir:: OwnerId { def_id } ;
1283- self . with_hir_id_owner ( * node_id, |this| {
1284- let fields = this. arena . alloc_from_iter (
1285- fields. iter ( ) . enumerate ( ) . map ( |f| this. lower_field_def ( f) ) ,
1286- ) ;
1287- let span = t. span ;
1288- let variant_data =
1289- hir:: VariantData :: Struct { fields, recovered : ast:: Recovered :: No } ;
1290- // FIXME: capture the generics from the outer adt.
1291- let generics = hir:: Generics :: empty ( ) ;
1292- let kind = match t. kind {
1293- TyKind :: AnonStruct ( ..) => hir:: ItemKind :: Struct ( variant_data, generics) ,
1294- TyKind :: AnonUnion ( ..) => hir:: ItemKind :: Union ( variant_data, generics) ,
1295- _ => unreachable ! ( ) ,
1296- } ;
1297- hir:: OwnerNode :: Item ( this. arena . alloc ( hir:: Item {
1298- ident : Ident :: new ( kw:: Empty , span) ,
1299- owner_id,
1300- kind,
1301- span : this. lower_span ( span) ,
1302- vis_span : this. lower_span ( span. shrink_to_lo ( ) ) ,
1303- } ) )
1304- } ) ;
1305- hir:: TyKind :: AnonAdt ( hir:: ItemId { owner_id } )
1306- }
13071267 TyKind :: Slice ( ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
13081268 TyKind :: Ptr ( mt) => hir:: TyKind :: Ptr ( self . lower_mt ( mt, itctx) ) ,
13091269 TyKind :: Ref ( region, mt) => {
0 commit comments