Skip to content

Commit

Permalink
Annotate raw pointer target types
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 committed Dec 23, 2017
1 parent 1e2bd70 commit 0563701
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/librustc_data_structures/array_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl<A: Array> ArrayVec<A> {
// Use the borrow in the IterMut to indicate borrowing behavior of the
// whole Drain iterator (like &mut T).
let range_slice = {
let arr = &mut self.values as &mut [ManuallyDrop<_>];
let arr = &mut self.values as &mut [ManuallyDrop<<A as Array>::Element>];
slice::from_raw_parts_mut(arr.as_mut_ptr().offset(start as isize),
end - start)
};
Expand Down Expand Up @@ -260,7 +260,8 @@ impl<'a, A: Array> Drop for Drain<'a, A> {
let start = source_array_vec.len();
let tail = self.tail_start;
{
let arr = &mut source_array_vec.values as &mut [ManuallyDrop<_>];
let arr =
&mut source_array_vec.values as &mut [ManuallyDrop<<A as Array>::Element>];
let src = arr.as_ptr().offset(tail as isize);
let dst = arr.as_mut_ptr().offset(start as isize);
ptr::copy(src, dst, self.tail_len);
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ fn symlink_junction_inner(target: &Path, junction: &Path) -> io::Result<()> {
let mut data = [0u8; c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
let db = data.as_mut_ptr()
as *mut c::REPARSE_MOUNTPOINT_DATA_BUFFER;
let buf = &mut (*db).ReparseTarget as *mut _;
let buf = &mut (*db).ReparseTarget as *mut c::WCHAR;
let mut i = 0;
// FIXME: this conversion is very hacky
let v = br"\??\";
Expand Down

0 comments on commit 0563701

Please sign in to comment.