diff options
| author | Dániel Buga <bugadani@gmail.com> | 2021-01-29 08:31:08 +0100 |
|---|---|---|
| committer | Dániel Buga <bugadani@gmail.com> | 2021-02-01 09:23:39 +0100 |
| commit | b87e1ecdf05d4fb2d14f13d760bb37098c58b06e (patch) | |
| tree | 366f3510245bdb4f2783398babd5da30fac59d89 /compiler/rustc_builtin_macros/src/global_allocator.rs | |
| parent | fee0d31397c5ac46d08867e903131d1d73825a9e (diff) | |
| download | rust-b87e1ecdf05d4fb2d14f13d760bb37098c58b06e.tar.gz rust-b87e1ecdf05d4fb2d14f13d760bb37098c58b06e.zip | |
Box the biggest ast::ItemKind variants
Diffstat (limited to 'compiler/rustc_builtin_macros/src/global_allocator.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/global_allocator.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_builtin_macros/src/global_allocator.rs b/compiler/rustc_builtin_macros/src/global_allocator.rs index e976805d9dd..9b43c11f0f3 100644 --- a/compiler/rustc_builtin_macros/src/global_allocator.rs +++ b/compiler/rustc_builtin_macros/src/global_allocator.rs @@ -5,7 +5,7 @@ use rustc_ast::expand::allocator::{ }; use rustc_ast::ptr::P; use rustc_ast::{self as ast, Attribute, Expr, FnHeader, FnSig, Generics, Param, StmtKind}; -use rustc_ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafe}; +use rustc_ast::{FnKind, ItemKind, Mutability, Stmt, Ty, TyKind, Unsafe}; use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::Span; @@ -85,7 +85,8 @@ 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(ast::Defaultness::Final, sig, Generics::default(), block); + let kind = + ItemKind::Fn(box 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), |
