Skip to content

Commit c240758

Browse files
authored
Rollup merge of #152937 - cyrgani:box-box, r=JonathanBrouwer
remove unneeded reboxing Just a small thing I noticed while experimenting with replacing `box_syntax` with `deref_patterns` in the compiler.
2 parents e3a3ce7 + 223c253 commit c240758

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4211,9 +4211,7 @@ impl ForeignItemKind {
42114211
impl From<ForeignItemKind> for ItemKind {
42124212
fn from(foreign_item_kind: ForeignItemKind) -> ItemKind {
42134213
match foreign_item_kind {
4214-
ForeignItemKind::Static(box static_foreign_item) => {
4215-
ItemKind::Static(Box::new(static_foreign_item))
4216-
}
4214+
ForeignItemKind::Static(static_foreign_item) => ItemKind::Static(static_foreign_item),
42174215
ForeignItemKind::Fn(fn_kind) => ItemKind::Fn(fn_kind),
42184216
ForeignItemKind::TyAlias(ty_alias_kind) => ItemKind::TyAlias(ty_alias_kind),
42194217
ForeignItemKind::MacCall(a) => ItemKind::MacCall(a),
@@ -4226,7 +4224,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
42264224

42274225
fn try_from(item_kind: ItemKind) -> Result<ForeignItemKind, ItemKind> {
42284226
Ok(match item_kind {
4229-
ItemKind::Static(box static_item) => ForeignItemKind::Static(Box::new(static_item)),
4227+
ItemKind::Static(static_item) => ForeignItemKind::Static(static_item),
42304228
ItemKind::Fn(fn_kind) => ForeignItemKind::Fn(fn_kind),
42314229
ItemKind::TyAlias(ty_alias_kind) => ForeignItemKind::TyAlias(ty_alias_kind),
42324230
ItemKind::MacCall(a) => ForeignItemKind::MacCall(a),

0 commit comments

Comments
 (0)