Skip to content

Commit 0563701

Browse files
committed
Annotate raw pointer target types
cc rust-lang#46906 cc rust-lang#46914
1 parent 1e2bd70 commit 0563701

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_data_structures/array_vec.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<A: Array> ArrayVec<A> {
138138
// Use the borrow in the IterMut to indicate borrowing behavior of the
139139
// whole Drain iterator (like &mut T).
140140
let range_slice = {
141-
let arr = &mut self.values as &mut [ManuallyDrop<_>];
141+
let arr = &mut self.values as &mut [ManuallyDrop<<A as Array>::Element>];
142142
slice::from_raw_parts_mut(arr.as_mut_ptr().offset(start as isize),
143143
end - start)
144144
};
@@ -260,7 +260,8 @@ impl<'a, A: Array> Drop for Drain<'a, A> {
260260
let start = source_array_vec.len();
261261
let tail = self.tail_start;
262262
{
263-
let arr = &mut source_array_vec.values as &mut [ManuallyDrop<_>];
263+
let arr =
264+
&mut source_array_vec.values as &mut [ManuallyDrop<<A as Array>::Element>];
264265
let src = arr.as_ptr().offset(tail as isize);
265266
let dst = arr.as_mut_ptr().offset(start as isize);
266267
ptr::copy(src, dst, self.tail_len);

src/libstd/sys/windows/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ fn symlink_junction_inner(target: &Path, junction: &Path) -> io::Result<()> {
770770
let mut data = [0u8; c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
771771
let db = data.as_mut_ptr()
772772
as *mut c::REPARSE_MOUNTPOINT_DATA_BUFFER;
773-
let buf = &mut (*db).ReparseTarget as *mut _;
773+
let buf = &mut (*db).ReparseTarget as *mut c::WCHAR;
774774
let mut i = 0;
775775
// FIXME: this conversion is very hacky
776776
let v = br"\??\";

0 commit comments

Comments
 (0)