Skip to content

Commit

Permalink
rename first_mut_ptr -> first_ptr_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jan 28, 2019
1 parent 33a969d commit 6a52ca3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
} else {
unsafe {
slice::from_raw_parts_mut(
MaybeUninit::first_mut_ptr(&mut (*self.as_leaf_mut()).keys),
MaybeUninit::first_ptr_mut(&mut (*self.as_leaf_mut()).keys),
self.len()
)
}
Expand All @@ -661,7 +661,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
debug_assert!(!self.is_shared_root());
unsafe {
slice::from_raw_parts_mut(
MaybeUninit::first_mut_ptr(&mut (*self.as_leaf_mut()).vals),
MaybeUninit::first_ptr_mut(&mut (*self.as_leaf_mut()).vals),
self.len()
)
}
Expand Down Expand Up @@ -749,7 +749,7 @@ impl<'a, K, V> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
slice_insert(self.vals_mut(), 0, val);
slice_insert(
slice::from_raw_parts_mut(
MaybeUninit::first_mut_ptr(&mut self.as_internal_mut().edges),
MaybeUninit::first_ptr_mut(&mut self.as_internal_mut().edges),
self.len()+1
),
0,
Expand Down Expand Up @@ -808,7 +808,7 @@ impl<'a, K, V> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> {
ForceResult::Internal(mut internal) => {
let edge = slice_remove(
slice::from_raw_parts_mut(
MaybeUninit::first_mut_ptr(&mut internal.as_internal_mut().edges),
MaybeUninit::first_ptr_mut(&mut internal.as_internal_mut().edges),
old_len+1
),
0
Expand Down Expand Up @@ -1087,7 +1087,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::

slice_insert(
slice::from_raw_parts_mut(
MaybeUninit::first_mut_ptr(&mut self.node.as_internal_mut().edges),
MaybeUninit::first_ptr_mut(&mut self.node.as_internal_mut().edges),
self.node.len()
),
self.idx + 1,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ macro_rules! impl_Display {
};
let mut buf = uninitialized_array![u8; 39];
let mut curr = buf.len() as isize;
let buf_ptr = MaybeUninit::first_mut_ptr(&mut buf);
let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);
let lut_ptr = DEC_DIGITS_LUT.as_ptr();

unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ impl<T> MaybeUninit<T> {
/// Get a mutable pointer to the first element of the array.
#[unstable(feature = "maybe_uninit", issue = "53491")]
#[inline(always)]
pub fn first_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
pub fn first_ptr_mut(this: &mut [MaybeUninit<T>]) -> *mut T {
this as *mut [MaybeUninit<T>] as *mut T
}
}
8 changes: 4 additions & 4 deletions src/libcore/slice/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize

if start_l == end_l {
// Trace `block_l` elements from the left side.
start_l = MaybeUninit::first_mut_ptr(&mut offsets_l);
end_l = MaybeUninit::first_mut_ptr(&mut offsets_l);
start_l = MaybeUninit::first_ptr_mut(&mut offsets_l);
end_l = MaybeUninit::first_ptr_mut(&mut offsets_l);
let mut elem = l;

for i in 0..block_l {
Expand All @@ -278,8 +278,8 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize

if start_r == end_r {
// Trace `block_r` elements from the right side.
start_r = MaybeUninit::first_mut_ptr(&mut offsets_r);
end_r = MaybeUninit::first_mut_ptr(&mut offsets_r);
start_r = MaybeUninit::first_ptr_mut(&mut offsets_r);
end_r = MaybeUninit::first_ptr_mut(&mut offsets_r);
let mut elem = r;

for i in 0..block_r {
Expand Down

0 comments on commit 6a52ca3

Please sign in to comment.