diff options
| author | est31 <MTest31@outlook.com> | 2021-08-05 03:53:21 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2021-08-18 09:25:26 +0200 |
| commit | 489744f90052960dbf8e8f8c502a16e5bafd15a1 (patch) | |
| tree | 0e482f3b08fe09b17f0ec158857e86bce56b30d9 | |
| parent | 1cd1cd034b6501cbfbd78a4d034e74aa188fb00e (diff) | |
| download | rust-489744f90052960dbf8e8f8c502a16e5bafd15a1.tar.gz rust-489744f90052960dbf8e8f8c502a16e5bafd15a1.zip | |
Remove box syntax from rustc_builtin_macros
5 files changed, 24 insertions, 12 deletions
diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index 417dedab60d..61af4979e70 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -527,12 +527,12 @@ impl<'a> TraitDef<'a> { tokens: None, }, attrs: Vec::new(), - kind: ast::AssocItemKind::TyAlias(box ast::TyAliasKind( + kind: ast::AssocItemKind::TyAlias(Box::new(ast::TyAliasKind( ast::Defaultness::Final, Generics::default(), Vec::new(), Some(type_def.to_ty(cx, self.span, type_ident, generics)), - )), + ))), tokens: None, }) }); @@ -698,7 +698,7 @@ impl<'a> TraitDef<'a> { self.span, Ident::invalid(), a, - ast::ItemKind::Impl(box ast::ImplKind { + ast::ItemKind::Impl(Box::new(ast::ImplKind { unsafety, polarity: ast::ImplPolarity::Positive, defaultness: ast::Defaultness::Final, @@ -707,7 +707,7 @@ impl<'a> TraitDef<'a> { of_trait: opt_trait_ref, self_ty: self_type, items: methods.into_iter().chain(associated_types).collect(), - }), + })), ) } @@ -940,7 +940,12 @@ impl<'a> MethodDef<'a> { tokens: None, }, ident: method_ident, - kind: ast::AssocItemKind::Fn(box ast::FnKind(def, sig, fn_generics, Some(body_block))), + kind: ast::AssocItemKind::Fn(Box::new(ast::FnKind( + def, + sig, + fn_generics, + Some(body_block), + ))), tokens: None, }) } diff --git a/compiler/rustc_builtin_macros/src/deriving/mod.rs b/compiler/rustc_builtin_macros/src/deriving/mod.rs index 7dea6099f8f..572ec6e242e 100644 --- a/compiler/rustc_builtin_macros/src/deriving/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/mod.rs @@ -179,7 +179,7 @@ fn inject_impl_of_structural_trait( span, Ident::invalid(), attrs, - ItemKind::Impl(box ImplKind { + ItemKind::Impl(Box::new(ImplKind { unsafety: ast::Unsafe::No, polarity: ast::ImplPolarity::Positive, defaultness: ast::Defaultness::Final, @@ -188,7 +188,7 @@ fn inject_impl_of_structural_trait( of_trait: Some(trait_ref), self_ty: self_type, items: Vec::new(), - }), + })), ); push(Annotatable::Item(newitem)); diff --git a/compiler/rustc_builtin_macros/src/global_allocator.rs b/compiler/rustc_builtin_macros/src/global_allocator.rs index a97cac7e514..3f71ee6f489 100644 --- a/compiler/rustc_builtin_macros/src/global_allocator.rs +++ b/compiler/rustc_builtin_macros/src/global_allocator.rs @@ -85,8 +85,12 @@ impl AllocFnFactory<'_, '_> { let header = FnHeader { unsafety: Unsafe::Yes(self.span), ..FnHeader::default() }; let sig = FnSig { decl, header, span: self.span }; let block = Some(self.cx.block_expr(output_expr)); - let kind = - ItemKind::Fn(box FnKind(ast::Defaultness::Final, sig, Generics::default(), block)); + let kind = ItemKind::Fn(Box::new(FnKind( + ast::Defaultness::Final, + sig, + Generics::default(), + block, + ))); let item = self.cx.item( self.span, Ident::from_str_and_span(&self.kind.fn_name(method.name), self.span), diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index b1be50b0bf9..d1d276930b9 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -3,7 +3,6 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(box_patterns)] -#![feature(box_syntax)] #![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(decl_macro)] diff --git a/compiler/rustc_builtin_macros/src/test_harness.rs b/compiler/rustc_builtin_macros/src/test_harness.rs index 74a97a4058f..be24b60294b 100644 --- a/compiler/rustc_builtin_macros/src/test_harness.rs +++ b/compiler/rustc_builtin_macros/src/test_harness.rs @@ -315,8 +315,12 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> { let decl = ecx.fn_decl(vec![], ast::FnRetTy::Ty(main_ret_ty)); let sig = ast::FnSig { decl, header: ast::FnHeader::default(), span: sp }; let def = ast::Defaultness::Final; - let main = - ast::ItemKind::Fn(box ast::FnKind(def, sig, ast::Generics::default(), Some(main_body))); + let main = ast::ItemKind::Fn(Box::new(ast::FnKind( + def, + sig, + ast::Generics::default(), + Some(main_body), + ))); // Honor the reexport_test_harness_main attribute let main_id = match cx.reexport_test_harness_main { |
