Skip to content

Commit 96e5412

Browse files
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]>
2 parents 064ff63 + 11825ac commit 96e5412

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/hir_def/src/type_ref.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ impl TraitRef {
7272
}
7373

7474
/// 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.
7579
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
7680
pub enum TypeRef {
7781
Never,

0 commit comments

Comments
 (0)