diff options
| author | bors <bors@rust-lang.org> | 2021-05-15 07:44:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-15 07:44:21 +0000 |
| commit | c6dd87a6b4a62cf5d2cb6207b1dcea652ea1aa60 (patch) | |
| tree | aadfe2d1acf52331a944900269c7445488ef863c /src | |
| parent | 428636f954204abb8a561a0bd08dc340fc0985c0 (diff) | |
| parent | f57537e5f3f81426c0eed2a318efe636e9966174 (diff) | |
| download | rust-c6dd87a6b4a62cf5d2cb6207b1dcea652ea1aa60.tar.gz rust-c6dd87a6b4a62cf5d2cb6207b1dcea652ea1aa60.zip | |
Auto merge of #85311 - camelid:box-blanket-impl, r=jyn514
Box `Impl.blanket_impl` to reduce size Blanket impls are probably not super common, and `Type` is a fairly large type, so this should reduce `Impl`'s size by a lot: `Option<Type>` is around 96 bytes, and `Option<Box<Type>>` is 8 bytes, so it's a big difference!
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/blanket_impl.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/types.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 68856f82fe9..090314e3a4b 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -119,7 +119,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { .clean(self.cx), negative_polarity: false, synthetic: false, - blanket_impl: Some(trait_ref.self_ty().clean(self.cx)), + blanket_impl: Some(box trait_ref.self_ty().clean(self.cx)), }), cfg: None, }); diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 7d802636bfa..f0e04018242 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -2235,7 +2235,7 @@ crate struct Impl { crate items: Vec<Item>, crate negative_polarity: bool, crate synthetic: bool, - crate blanket_impl: Option<Type>, + crate blanket_impl: Option<Box<Type>>, } impl Impl { diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index e0e5db3b563..d2349b42ae9 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -482,7 +482,7 @@ impl FromWithTcx<clean::Impl> for Impl { items: ids(items), negative: negative_polarity, synthetic, - blanket_impl: blanket_impl.map(|x| x.into_tcx(tcx)), + blanket_impl: blanket_impl.map(|x| (*x).into_tcx(tcx)), } } } |
