From 11825ac5fee8616ea7de2c80b5298978e7906bf1 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 23 May 2021 16:28:23 +0200 Subject: Explain why nested `TypeRef` aren't interned --- crates/hir_def/src/type_ref.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates') 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 { } /// Compare ty::Ty +/// +/// Note: Most users of `TypeRef` that end up in the salsa database intern it using +/// `Interned` to save space. But notably, nested `TypeRef`s are not interned, since that +/// does not seem to save any noticeable amount of memory. #[derive(Clone, PartialEq, Eq, Hash, Debug)] pub enum TypeRef { Never, -- cgit v1.2.3