Shrink TypeRef from 16 from 32 bytes

Only references and arrays need to be boxed, and they comprise only 9.4% of the types (according to counting on r-a's code).

This saves 17mb.
This commit is contained in:
Chayim Refael Friedman 2024-10-20 01:56:51 +03:00
parent 061e5d7f71
commit bf7edd3783
10 changed files with 178 additions and 149 deletions

View file

@ -2420,8 +2420,8 @@ impl SelfParam {
func_data
.params
.first()
.map(|&param| match func_data.types_map[param] {
TypeRef::Reference(.., mutability) => match mutability {
.map(|&param| match &func_data.types_map[param] {
TypeRef::Reference(ref_) => match ref_.mutability {
hir_def::type_ref::Mutability::Shared => Access::Shared,
hir_def::type_ref::Mutability::Mut => Access::Exclusive,
},