Skip to content

Commit a33d761

Browse files
committed
Test fixes and rebase conflicts from rollup
1 parent 40811f8 commit a33d761

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl<T> Vec<T> {
231231
/// }
232232
///
233233
/// // Put everything back together into a Vec
234-
/// let rebuilt = Vec::from_raw_parts(len, cap, p);
234+
/// let rebuilt = Vec::from_raw_parts(p, len, cap);
235235
/// assert_eq!(rebuilt, vec![4i, 5i, 6i]);
236236
/// }
237237
/// }

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

src/test/run-pass/issue-17458.rs renamed to src/test/compile-fail/issue-17458.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
static X: uint = 0 as *const uint as uint;
12+
//~^ ERROR: can not cast a pointer to an integer in a constant expression
1213

1314
fn main() {
1415
assert_eq!(X, 0);

src/test/run-pass/issue-16668.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-pretty
12+
1113
#![feature(unboxed_closures)]
1214

1315
struct Parser<'a, I, O> {

0 commit comments

Comments
 (0)