File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ pub unsafe fn replace_ptr<T>(dest: *mut T, mut src: T) -> T {
155
155
* Reads the value from `*src` and returns it. Does not copy `*src`.
156
156
*/
157
157
#[ inline( always) ]
158
- pub unsafe fn read_ptr < T > ( src : * mut T ) -> T {
158
+ pub unsafe fn read_ptr < T > ( src : * T ) -> T {
159
159
let mut tmp: T = intrinsics:: uninit ( ) ;
160
160
copy_nonoverlapping_memory ( & mut tmp, src, 1 ) ;
161
161
tmp
@@ -168,7 +168,7 @@ pub unsafe fn read_ptr<T>(src: *mut T) -> T {
168
168
#[ inline( always) ]
169
169
pub unsafe fn read_and_zero_ptr < T > ( dest : * mut T ) -> T {
170
170
// Copy the data out from `dest`:
171
- let tmp = read_ptr ( dest) ;
171
+ let tmp = read_ptr ( & * dest) ;
172
172
173
173
// Now zero out `dest`:
174
174
zero_memory ( dest, 1 ) ;
Original file line number Diff line number Diff line change @@ -1527,7 +1527,7 @@ impl<T> OwnedVector<T> for ~[T] {
1527
1527
let valptr = ptr:: to_mut_unsafe_ptr ( & mut self [ ln - 1 u] ) ;
1528
1528
unsafe {
1529
1529
raw:: set_len ( self , ln - 1 u) ;
1530
- Some ( ptr:: read_ptr ( valptr) )
1530
+ Some ( ptr:: read_ptr ( & * valptr) )
1531
1531
}
1532
1532
}
1533
1533
}
You can’t perform that action at this time.
0 commit comments