@@ -211,14 +211,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
211211 i : & ItemKind ,
212212 ) -> Vec < hir:: Attribute > {
213213 match i {
214- ItemKind :: Fn ( box Fn { eii_impls, .. } )
215- | ItemKind :: Static ( box StaticItem { eii_impls, .. } )
214+ ItemKind :: Fn ( Fn { eii_impls, .. } ) | ItemKind :: Static ( StaticItem { eii_impls, .. } )
216215 if eii_impls. is_empty ( ) =>
217216 {
218217 Vec :: new ( )
219218 }
220- ItemKind :: Fn ( box Fn { eii_impls, .. } )
221- | ItemKind :: Static ( box StaticItem { eii_impls, .. } ) => {
219+ ItemKind :: Fn ( Fn { eii_impls, .. } ) | ItemKind :: Static ( StaticItem { eii_impls, .. } ) => {
222220 vec ! [ hir:: Attribute :: Parsed ( AttributeKind :: EiiImpls (
223221 eii_impls. iter( ) . map( |i| self . lower_eii_impl( i) ) . collect( ) ,
224222 ) ) ]
@@ -298,7 +296,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
298296
299297 self . lower_use_tree ( use_tree, & prefix, id, vis_span, attrs)
300298 }
301- ItemKind :: Static ( box ast:: StaticItem {
299+ ItemKind :: Static ( ast:: StaticItem {
302300 ident,
303301 ty,
304302 safety : _,
@@ -314,7 +312,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
314312 self . lower_define_opaque ( hir_id, define_opaque) ;
315313 hir:: ItemKind :: Static ( * m, ident, ty, body_id)
316314 }
317- ItemKind :: Const ( box ConstItem {
315+ ItemKind :: Const ( ConstItem {
318316 defaultness : _,
319317 ident,
320318 generics,
@@ -352,7 +350,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
352350 self . record_body ( & [ ] , body)
353351 } ) ,
354352 ) ,
355- ItemKind :: Fn ( box Fn {
353+ ItemKind :: Fn ( Fn {
356354 sig : FnSig { decl, header, span : fn_sig_span } ,
357355 ident,
358356 generics,
@@ -419,7 +417,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
419417 self . lower_body ( |this| ( & [ ] , this. expr ( span, hir:: ExprKind :: InlineAsm ( asm) ) ) ) ;
420418 hir:: ItemKind :: GlobalAsm { asm, fake_body }
421419 }
422- ItemKind :: TyAlias ( box TyAlias { ident, generics, after_where_clause, ty, .. } ) => {
420+ ItemKind :: TyAlias ( TyAlias { ident, generics, after_where_clause, ty, .. } ) => {
423421 // We lower
424422 //
425423 // type Foo = impl Trait
@@ -539,7 +537,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
539537 constness,
540538 } )
541539 }
542- ItemKind :: Trait ( box Trait {
540+ ItemKind :: Trait ( Trait {
543541 impl_restriction,
544542 constness,
545543 is_auto,
@@ -580,7 +578,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
580578 items,
581579 }
582580 }
583- ItemKind :: TraitAlias ( box TraitAlias { constness, ident, generics, bounds } ) => {
581+ ItemKind :: TraitAlias ( TraitAlias { constness, ident, generics, bounds } ) => {
584582 let constness = self . lower_constness ( * constness) ;
585583 let ident = self . lower_ident ( * ident) ;
586584 let ( generics, bounds) = self . lower_generics (
@@ -615,7 +613,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
615613 } ) ;
616614 hir:: ItemKind :: Macro ( ident, macro_def, macro_kinds)
617615 }
618- ItemKind :: Delegation ( box delegation) => {
616+ ItemKind :: Delegation ( delegation) => {
619617 let delegation_results = self . lower_delegation ( delegation, id) ;
620618 hir:: ItemKind :: Fn {
621619 sig : delegation_results. sig ,
@@ -794,7 +792,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
794792 let attrs =
795793 self . lower_attrs ( hir_id, & i. attrs , i. span , Target :: from_foreign_item_kind ( & i. kind ) ) ;
796794 let ( ident, kind) = match & i. kind {
797- ForeignItemKind :: Fn ( box Fn { sig, ident, generics, define_opaque, .. } ) => {
795+ ForeignItemKind :: Fn ( Fn { sig, ident, generics, define_opaque, .. } ) => {
798796 let fdec = & sig. decl ;
799797 let itctx = ImplTraitContext :: Universal ;
800798 let ( generics, ( decl, fn_args) ) =
@@ -822,7 +820,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
822820 ) ,
823821 )
824822 }
825- ForeignItemKind :: Static ( box StaticItem {
823+ ForeignItemKind :: Static ( StaticItem {
826824 ident,
827825 ty,
828826 mutability,
@@ -839,9 +837,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
839837 }
840838 ( ident, hir:: ForeignItemKind :: Static ( ty, * mutability, safety) )
841839 }
842- ForeignItemKind :: TyAlias ( box TyAlias { ident, .. } ) => {
843- ( ident, hir:: ForeignItemKind :: Type )
844- }
840+ ForeignItemKind :: TyAlias ( TyAlias { ident, .. } ) => ( ident, hir:: ForeignItemKind :: Type ) ,
845841 ForeignItemKind :: MacCall ( _) => panic ! ( "macro shouldn't exist here" ) ,
846842 } ;
847843
@@ -980,7 +976,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
980976 let trait_item_def_id = hir_id. expect_owner ( ) ;
981977
982978 let ( ident, generics, kind, has_value) = match & i. kind {
983- AssocItemKind :: Const ( box ConstItem {
979+ AssocItemKind :: Const ( ConstItem {
984980 ident,
985981 generics,
986982 ty,
@@ -1020,9 +1016,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10201016
10211017 ( * ident, generics, kind, rhs_kind. has_expr ( ) )
10221018 }
1023- AssocItemKind :: Fn ( box Fn {
1024- sig, ident, generics, body : None , define_opaque, ..
1025- } ) => {
1019+ AssocItemKind :: Fn ( Fn { sig, ident, generics, body : None , define_opaque, .. } ) => {
10261020 // FIXME(contracts): Deny contract here since it won't apply to
10271021 // any impl method or callees.
10281022 let idents = self . lower_fn_params_to_idents ( & sig. decl ) ;
@@ -1047,7 +1041,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10471041 false ,
10481042 )
10491043 }
1050- AssocItemKind :: Fn ( box Fn {
1044+ AssocItemKind :: Fn ( Fn {
10511045 sig,
10521046 ident,
10531047 generics,
@@ -1082,7 +1076,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10821076 true ,
10831077 )
10841078 }
1085- AssocItemKind :: Type ( box TyAlias {
1079+ AssocItemKind :: Type ( TyAlias {
10861080 ident,
10871081 generics,
10881082 after_where_clause,
@@ -1115,7 +1109,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11151109 ) ;
11161110 ( * ident, generics, kind, ty. is_some ( ) )
11171111 }
1118- AssocItemKind :: Delegation ( box delegation) => {
1112+ AssocItemKind :: Delegation ( delegation) => {
11191113 let delegation_results = self . lower_delegation ( delegation, i. id ) ;
11201114 let item_kind = hir:: TraitItemKind :: Fn (
11211115 delegation_results. sig ,
@@ -1216,7 +1210,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12161210 ) ;
12171211
12181212 let ( ident, ( generics, kind) ) = match & i. kind {
1219- AssocItemKind :: Const ( box ConstItem {
1213+ AssocItemKind :: Const ( ConstItem {
12201214 ident,
12211215 generics,
12221216 ty,
@@ -1240,14 +1234,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
12401234 } ,
12411235 ) ,
12421236 ) ,
1243- AssocItemKind :: Fn ( box Fn {
1244- sig,
1245- ident,
1246- generics,
1247- body,
1248- contract,
1249- define_opaque,
1250- ..
1237+ AssocItemKind :: Fn ( Fn {
1238+ sig, ident, generics, body, contract, define_opaque, ..
12511239 } ) => {
12521240 let body_id = self . lower_maybe_coroutine_body (
12531241 sig. span ,
@@ -1271,9 +1259,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12711259
12721260 ( * ident, ( generics, hir:: ImplItemKind :: Fn ( sig, body_id) ) )
12731261 }
1274- AssocItemKind :: Type ( box TyAlias {
1275- ident, generics, after_where_clause, ty, ..
1276- } ) => {
1262+ AssocItemKind :: Type ( TyAlias { ident, generics, after_where_clause, ty, .. } ) => {
12771263 let mut generics = generics. clone ( ) ;
12781264 add_ty_alias_where_clause ( & mut generics, after_where_clause, false ) ;
12791265 (
@@ -1307,7 +1293,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
13071293 ) ,
13081294 )
13091295 }
1310- AssocItemKind :: Delegation ( box delegation) => {
1296+ AssocItemKind :: Delegation ( delegation) => {
13111297 let delegation_results = self . lower_delegation ( delegation, i. id ) ;
13121298 (
13131299 delegation. ident ,
0 commit comments