We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2469ed0 commit a61a85eCopy full SHA for a61a85e
library/proc_macro/src/bridge/handle.rs
@@ -8,6 +8,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
8
9
pub(super) type Handle = NonZeroU32;
10
11
+/// A store that associates values of type `T` with numeric handles. A value can
12
+/// be looked up using its handle.
13
pub(super) struct OwnedStore<T: 'static> {
14
counter: &'static AtomicUsize,
15
data: BTreeMap<Handle, T>,
@@ -49,6 +51,7 @@ impl<T> IndexMut<Handle> for OwnedStore<T> {
49
51
}
50
52
53
54
+/// Like `OwnedStore`, but avoids storing any value more than once.
55
pub(super) struct InternedStore<T: 'static> {
56
owned: OwnedStore<T>,
57
interner: HashMap<T, Handle>,
0 commit comments