diff options
| author | bors <bors@rust-lang.org> | 2021-08-18 10:43:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-18 10:43:27 +0000 |
| commit | ba8cda2fa2c99ed6646f4dfe73bf4edad7e42a2d (patch) | |
| tree | 7adfa942c13a620d7ea6e0a9c0bb80e4eb5dd480 /compiler/rustc_parse | |
| parent | 896f058f13d6c8021f7637817953a44d3a78be32 (diff) | |
| parent | 0f081832b43db75073db2d8faecc84cf0ea7e271 (diff) | |
| download | rust-ba8cda2fa2c99ed6646f4dfe73bf4edad7e42a2d.tar.gz rust-ba8cda2fa2c99ed6646f4dfe73bf4edad7e42a2d.zip | |
Auto merge of #87781 - est31:remove_box, r=oli-obk
Remove box syntax from compiler and tools Removes box syntax from the compiler and tools. In #49733, the future of box syntax is uncertain and the use in the compiler was listed as one of the reasons to keep it. Removal of box syntax [might affect the code generated](https://github.com/rust-lang/rust/pull/49646#issuecomment-379219615) and slow down the compiler so I'd recommend doing a perf run on this.
Diffstat (limited to 'compiler/rustc_parse')
| -rw-r--r-- | compiler/rustc_parse/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 14 |
2 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index ed3b51dc14a..611d72e61d0 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -3,7 +3,6 @@ #![feature(array_windows)] #![feature(crate_visibility_modifier)] #![cfg_attr(bootstrap, feature(bindings_after_at))] -#![feature(box_syntax)] #![feature(box_patterns)] #![recursion_limit = "256"] diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 4f41e3cfde4..e5537d43eba 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -221,7 +221,7 @@ impl<'a> Parser<'a> { } else if self.check_fn_front_matter(def_final) { // FUNCTION ITEM let (ident, sig, generics, body) = self.parse_fn(attrs, req_name, lo)?; - (ident, ItemKind::Fn(box FnKind(def(), sig, generics, body))) + (ident, ItemKind::Fn(Box::new(FnKind(def(), sig, generics, body)))) } else if self.eat_keyword(kw::Extern) { if self.eat_keyword(kw::Crate) { // EXTERN CRATE @@ -548,7 +548,7 @@ impl<'a> Parser<'a> { }; let trait_ref = TraitRef { path, ref_id: ty_first.id }; - ItemKind::Impl(box ImplKind { + ItemKind::Impl(Box::new(ImplKind { unsafety, polarity, defaultness, @@ -557,11 +557,11 @@ impl<'a> Parser<'a> { of_trait: Some(trait_ref), self_ty: ty_second, items: impl_items, - }) + })) } None => { // impl Type - ItemKind::Impl(box ImplKind { + ItemKind::Impl(Box::new(ImplKind { unsafety, polarity, defaultness, @@ -570,7 +570,7 @@ impl<'a> Parser<'a> { of_trait: None, self_ty: ty_first, items: impl_items, - }) + })) } }; @@ -710,7 +710,7 @@ impl<'a> Parser<'a> { // It's a normal trait. tps.where_clause = self.parse_where_clause()?; let items = self.parse_item_list(attrs, |p| p.parse_trait_item(ForceCollect::No))?; - Ok((ident, ItemKind::Trait(box TraitKind(is_auto, unsafety, tps, bounds, items)))) + Ok((ident, ItemKind::Trait(Box::new(TraitKind(is_auto, unsafety, tps, bounds, items))))) } } @@ -769,7 +769,7 @@ impl<'a> Parser<'a> { let default = if self.eat(&token::Eq) { Some(self.parse_ty()?) } else { None }; self.expect_semi()?; - Ok((ident, ItemKind::TyAlias(box TyAliasKind(def, generics, bounds, default)))) + Ok((ident, ItemKind::TyAlias(Box::new(TyAliasKind(def, generics, bounds, default))))) } /// Parses a `UseTree`. |
