]> git.lizzy.rs Git - rust.git/commitdiff
Merge #8944
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sun, 23 May 2021 14:29:18 +0000 (14:29 +0000)
committerGitHub <noreply@github.com>
Sun, 23 May 2021 14:29:18 +0000 (14:29 +0000)
8944: minor: explain why nested `TypeRef` aren't interned r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
crates/hir_def/src/type_ref.rs

index 9e44547cb03a6fbe432cd799f38f6dacba5e7614..cdcab71102da480043096510e5e553d771687016 100644 (file)
@@ -72,6 +72,10 @@ pub(crate) fn from_ast(ctx: &LowerCtx, node: ast::Type) -> Option<Self> {
 }
 
 /// Compare ty::Ty
+///
+/// Note: Most users of `TypeRef` that end up in the salsa database intern it using
+/// `Interned<TypeRef>` 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,