about summary refs log tree commit diff
path: root/src/librustdoc/html/render/cache.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-29 10:41:01 +0000
committerbors <bors@rust-lang.org>2020-12-29 10:41:01 +0000
commit158f8d034b15e65ba8dc0d066358dd0632bfcd6e (patch)
treeff4da49406acf0d16cc087eb51821586dc6d240d /src/librustdoc/html/render/cache.rs
parente2a2592885539ca97bfb1232669e7519a0c0703b (diff)
parent5fce0dd787f319d229ecbd679781655549a418f2 (diff)
downloadrust-158f8d034b15e65ba8dc0d066358dd0632bfcd6e.tar.gz
rust-158f8d034b15e65ba8dc0d066358dd0632bfcd6e.zip
Auto merge of #80014 - jyn514:box-item-kind, r=nnethercote
[rustdoc] Box ItemKind to reduce the size of `Item`

This brings the size of `Item` from

```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 536
```

to

```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 136
```

This is an alternative to https://github.com/rust-lang/rust/pull/79967; I don't think it makes sense to make both changes.

Helps with #79103.
Diffstat (limited to 'src/librustdoc/html/render/cache.rs')
-rw-r--r--src/librustdoc/html/render/cache.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs
index 25fe31aab59..c408e576639 100644
--- a/src/librustdoc/html/render/cache.rs
+++ b/src/librustdoc/html/render/cache.rs
@@ -165,7 +165,7 @@ crate fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
 }
 
 crate fn get_index_search_type(item: &clean::Item) -> Option<IndexItemFunctionType> {
-    let (all_types, ret_types) = match item.kind {
+    let (all_types, ret_types) = match *item.kind {
         clean::FunctionItem(ref f) => (&f.all_types, &f.ret_types),
         clean::MethodItem(ref m, _) => (&m.all_types, &m.ret_types),
         clean::TyMethodItem(ref m) => (&m.all_types, &m.ret_types),