summaryrefslogtreecommitdiffstats
path: root/vendor/string_cache/src/atom.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/string_cache/src/atom.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/string_cache/src/atom.rs')
-rw-r--r--vendor/string_cache/src/atom.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/vendor/string_cache/src/atom.rs b/vendor/string_cache/src/atom.rs
index c02651b31..321b0a40e 100644
--- a/vendor/string_cache/src/atom.rs
+++ b/vendor/string_cache/src/atom.rs
@@ -105,7 +105,7 @@ impl<Static> Atom<Static> {
}
impl<Static: StaticAtomSet> Atom<Static> {
- /// Return the internal repersentation. For testing.
+ /// Return the internal representation. For testing.
#[doc(hidden)]
pub fn unsafe_data(&self) -> u64 {
self.unsafe_data.get()
@@ -200,8 +200,7 @@ impl<'a, Static: StaticAtomSet> From<Cow<'a, str>> for Atom<Static> {
phantom: PhantomData,
}
} else {
- let ptr: std::ptr::NonNull<Entry> =
- DYNAMIC_SET.lock().insert(string_to_add, hash.g);
+ let ptr: std::ptr::NonNull<Entry> = DYNAMIC_SET.insert(string_to_add, hash.g);
let data = ptr.as_ptr() as u64;
debug_assert!(0 == data & TAG_MASK);
Atom {
@@ -237,9 +236,7 @@ impl<Static> Drop for Atom<Static> {
// Out of line to guide inlining.
fn drop_slow<Static>(this: &mut Atom<Static>) {
- DYNAMIC_SET
- .lock()
- .remove(this.unsafe_data.get() as *mut Entry);
+ DYNAMIC_SET.remove(this.unsafe_data.get() as *mut Entry);
}
}
}