diff options
| author | est31 <MTest31@outlook.com> | 2022-07-22 00:11:21 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-07-29 19:30:25 +0200 |
| commit | 1116fc164f1fce1cab2753fab294bfe016457a69 (patch) | |
| tree | 3c90c1d131dc7ef7f25cfe7918744b6dd1114227 /src/librustdoc/json | |
| parent | 96c051fd0743e52403f0c3dcdbdbb8297da4ac99 (diff) | |
Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItem
This reduces ItemKind size from 160 bytes to 112 bytes
Diffstat (limited to 'src/librustdoc/json')
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index b6ee385a833..716a4c9ea43 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -602,11 +602,11 @@ impl FromWithTcx<Box<clean::Impl>> for Impl { } pub(crate) fn from_function( - function: clean::Function, + function: Box<clean::Function>, header: rustc_hir::FnHeader, tcx: TyCtxt<'_>, ) -> Function { - let clean::Function { decl, generics } = function; + let clean::Function { decl, generics } = *function; Function { decl: decl.into_tcx(tcx), generics: generics.into_tcx(tcx), @@ -615,12 +615,12 @@ pub(crate) fn from_function( } pub(crate) fn from_function_method( - function: clean::Function, + function: Box<clean::Function>, has_body: bool, header: rustc_hir::FnHeader, tcx: TyCtxt<'_>, ) -> Method { - let clean::Function { decl, generics } = function; + let clean::Function { decl, generics } = *function; Method { decl: decl.into_tcx(tcx), generics: generics.into_tcx(tcx), |
