aboutsummaryrefslogtreecommitdiff
path: root/src/rustc_entry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rustc_entry.rs')
-rw-r--r--src/rustc_entry.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rustc_entry.rs b/src/rustc_entry.rs
index 1793c4a..465db47 100644
--- a/src/rustc_entry.rs
+++ b/src/rustc_entry.rs
@@ -574,8 +574,10 @@ impl<'a, K, V, A: Allocator + Clone> RustcVacantEntry<'a, K, V, A> {
/// ```
#[cfg_attr(feature = "inline-more", inline)]
pub fn insert(self, value: V) -> &'a mut V {
- let bucket = self.table.insert_no_grow(self.hash, (self.key, value));
- unsafe { &mut bucket.as_mut().1 }
+ unsafe {
+ let bucket = self.table.insert_no_grow(self.hash, (self.key, value));
+ &mut bucket.as_mut().1
+ }
}
/// Sets the value of the entry with the RustcVacantEntry's key,
@@ -596,7 +598,7 @@ impl<'a, K, V, A: Allocator + Clone> RustcVacantEntry<'a, K, V, A> {
/// ```
#[cfg_attr(feature = "inline-more", inline)]
pub fn insert_entry(self, value: V) -> RustcOccupiedEntry<'a, K, V, A> {
- let bucket = self.table.insert_no_grow(self.hash, (self.key, value));
+ let bucket = unsafe { self.table.insert_no_grow(self.hash, (self.key, value)) };
RustcOccupiedEntry {
key: None,
elem: bucket,