@@ -1783,7 +1783,7 @@ impl<A: Allocator + Clone> RawTableInner<A> {
1783
1783
/// [`RawTableInner::ctrl`]: RawTableInner::ctrl
1784
1784
/// [`RawTableInner::set_ctrl_h2`]: RawTableInner::set_ctrl_h2
1785
1785
#[ inline]
1786
- unsafe fn prepare_insert_slot ( & self , hash : u64 ) -> ( usize , u8 ) {
1786
+ unsafe fn prepare_insert_slot ( & mut self , hash : u64 ) -> ( usize , u8 ) {
1787
1787
let index: usize = self . find_insert_slot ( hash) . index ;
1788
1788
// SAFETY:
1789
1789
// 1. The `find_insert_slot` function either returns an `index` less than or
@@ -2054,7 +2054,7 @@ impl<A: Allocator + Clone> RawTableInner<A> {
2054
2054
/// [`Bucket::as_ptr`]: Bucket::as_ptr
2055
2055
/// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
2056
2056
#[ inline]
2057
- unsafe fn set_ctrl_h2 ( & self , index : usize , hash : u64 ) {
2057
+ unsafe fn set_ctrl_h2 ( & mut self , index : usize , hash : u64 ) {
2058
2058
// SAFETY: The caller must uphold the safety rules for the [`RawTableInner::set_ctrl_h2`]
2059
2059
self . set_ctrl ( index, h2 ( hash) ) ;
2060
2060
}
@@ -2088,7 +2088,7 @@ impl<A: Allocator + Clone> RawTableInner<A> {
2088
2088
/// [`Bucket::as_ptr`]: Bucket::as_ptr
2089
2089
/// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
2090
2090
#[ inline]
2091
- unsafe fn replace_ctrl_h2 ( & self , index : usize , hash : u64 ) -> u8 {
2091
+ unsafe fn replace_ctrl_h2 ( & mut self , index : usize , hash : u64 ) -> u8 {
2092
2092
// SAFETY: The caller must uphold the safety rules for the [`RawTableInner::replace_ctrl_h2`]
2093
2093
let prev_ctrl = * self . ctrl ( index) ;
2094
2094
self . set_ctrl_h2 ( index, hash) ;
@@ -2120,7 +2120,7 @@ impl<A: Allocator + Clone> RawTableInner<A> {
2120
2120
/// [`Bucket::as_ptr`]: Bucket::as_ptr
2121
2121
/// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
2122
2122
#[ inline]
2123
- unsafe fn set_ctrl ( & self , index : usize , ctrl : u8 ) {
2123
+ unsafe fn set_ctrl ( & mut self , index : usize , ctrl : u8 ) {
2124
2124
// Replicate the first Group::WIDTH control bytes at the end of
2125
2125
// the array without using a branch. If the tables smaller than
2126
2126
// the group width (self.buckets() < Group::WIDTH),
@@ -2909,7 +2909,7 @@ impl<T: Clone, A: Allocator + Clone> RawTable<T, A> {
2909
2909
{
2910
2910
self . clear ( ) ;
2911
2911
2912
- let guard_self = guard ( & mut * self , |self_| {
2912
+ let mut guard_self = guard ( & mut * self , |self_| {
2913
2913
// Clear the partially copied table if a panic occurs, otherwise
2914
2914
// items and growth_left will be out of sync with the contents
2915
2915
// of the table.
0 commit comments