Skip to content

Commit 7d917d5

Browse files
alexcrichtonSimonSapin
authored andcommitted
Test fixes and rebase conflicts from rollup
1 parent 66d5eb9 commit 7d917d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libstd/ascii.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ impl OwnedAsciiCast for Vec<u8> {
259259

260260
#[inline]
261261
unsafe fn into_ascii_nocheck(self) -> Vec<Ascii> {
262-
let v = Vec::from_raw_parts(self.len(),
263-
self.capacity(),
264-
mem::transmute(self.as_ptr()));
262+
let v = Vec::from_raw_parts(self.as_ptr() as *mut Ascii,
263+
self.len(),
264+
self.capacity());
265265

266266
// We forget `self` to avoid freeing it at the end of the scope
267267
// Otherwise, the returned `Vec` would point to freed memory
@@ -345,9 +345,9 @@ pub trait IntoBytes {
345345
impl IntoBytes for Vec<Ascii> {
346346
fn into_bytes(self) -> Vec<u8> {
347347
unsafe {
348-
let v = Vec::from_raw_parts(self.len(),
349-
self.capacity(),
350-
mem::transmute(self.as_ptr()));
348+
let v = Vec::from_raw_parts(self.as_ptr() as *mut u8,
349+
self.len(),
350+
self.capacity());
351351

352352
// We forget `self` to avoid freeing it at the end of the scope
353353
// Otherwise, the returned `Vec` would point to freed memory

0 commit comments

Comments
 (0)