From a61a85eb24ba6b65d48de1392d7021d15886223f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 13 May 2022 10:07:45 +1000 Subject: [PATCH] Add some comments. --- library/proc_macro/src/bridge/handle.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/proc_macro/src/bridge/handle.rs b/library/proc_macro/src/bridge/handle.rs index bcbb8681247..7d6adda48ec 100644 --- a/library/proc_macro/src/bridge/handle.rs +++ b/library/proc_macro/src/bridge/handle.rs @@ -8,6 +8,8 @@ use std::sync::atomic::{AtomicUsize, Ordering}; pub(super) type Handle = NonZeroU32; +/// A store that associates values of type `T` with numeric handles. A value can +/// be looked up using its handle. pub(super) struct OwnedStore { counter: &'static AtomicUsize, data: BTreeMap, @@ -49,6 +51,7 @@ impl IndexMut for OwnedStore { } } +/// Like `OwnedStore`, but avoids storing any value more than once. pub(super) struct InternedStore { owned: OwnedStore, interner: HashMap,