diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-23 15:29:18 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-23 15:29:18 +0100 |
commit | 96e5412f881608d703df129ed87f3488ad39a9e1 (patch) | |
tree | b21ff5fa69a61dcb16868bb21457a7b4117c22fb /crates/hir_def | |
parent | 064ff633f6055ed35022222c89af01d3f9943e3c (diff) | |
parent | 11825ac5fee8616ea7de2c80b5298978e7906bf1 (diff) |
Merge #8944
8944: minor: explain why nested `TypeRef` aren't interned r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/type_ref.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/type_ref.rs b/crates/hir_def/src/type_ref.rs index 9e44547cb..cdcab7110 100644 --- a/crates/hir_def/src/type_ref.rs +++ b/crates/hir_def/src/type_ref.rs | |||
@@ -72,6 +72,10 @@ impl TraitRef { | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /// Compare ty::Ty | 74 | /// Compare ty::Ty |
75 | /// | ||
76 | /// Note: Most users of `TypeRef` that end up in the salsa database intern it using | ||
77 | /// `Interned<TypeRef>` to save space. But notably, nested `TypeRef`s are not interned, since that | ||
78 | /// does not seem to save any noticeable amount of memory. | ||
75 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] | 79 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] |
76 | pub enum TypeRef { | 80 | pub enum TypeRef { |
77 | Never, | 81 | Never, |