Skip to content

Commit

Permalink
Test fixes from rollup
Browse files Browse the repository at this point in the history
Closes rust-lang#14210 (Make Vec.truncate() resilient against failure in Drop)
Closes rust-lang#14206 (Register new snapshots)
Closes rust-lang#14205 (use sched_yield on linux and freebsd)
Closes rust-lang#14204 (Add a crate for missing stubs from libcore)
Closes rust-lang#14201 (Render not_found with an absolute path to the rust stylesheet)
Closes rust-lang#14198 (update valgrind headers)
Closes rust-lang#14174 (Optimize common path of Once::doit)
Closes rust-lang#14162 (Print 'rustc' and 'rustdoc' as the command name for --version)
Closes rust-lang#14145 (Better strict version hash (SVH) computation)
  • Loading branch information
alexcrichton committed May 15, 2014
1 parent e593c86 commit dbd8315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/librlibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ extern "rust-intrinsic" {
}

#[no_mangle]
pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *u8, n: uint) {
pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *u8, n: uint) -> *mut u8 {
let mut i = 0;
while i < n {
*(offset(dest as *u8, i as int) as *mut u8) = *offset(src, i as int);
i += 1;
}
return dest;
}

#[no_mangle]
pub unsafe extern "C" fn memmove(dest: *mut u8, src: *u8, n: uint) {
pub unsafe extern "C" fn memmove(dest: *mut u8, src: *u8, n: uint) -> *mut u8 {
if src < dest as *u8 { // copy from end
let mut i = n;
while i != 0 {
Expand All @@ -68,15 +69,17 @@ pub unsafe extern "C" fn memmove(dest: *mut u8, src: *u8, n: uint) {
i += 1;
}
}
return dest;
}

#[no_mangle]
pub unsafe extern "C" fn memset(s: *mut u8, c: i32, n: uint) {
pub unsafe extern "C" fn memset(s: *mut u8, c: i32, n: uint) -> *mut u8 {
let mut i = 0;
while i < n {
*(offset(s as *u8, i as int) as *mut u8) = c as u8;
i += 1;
}
return s;
}

#[no_mangle]
Expand Down
9 changes: 5 additions & 4 deletions src/librustc/back/svh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ mod svh_visitor {
}

fn visit_struct_def(&mut self, s: &StructDef, ident: Ident,
g: &Generics, n: NodeId, e: E) {
g: &Generics, _n: NodeId, e: E) {
SawStructDef(content(ident)).hash(self.st);
// For some reason walk_struct_def does not call walk_generics.
visit::walk_generics(self, g, e.clone());
visit::walk_struct_def(self, s, ident, g, n, e)
visit::walk_struct_def(self, s, e)
}

fn visit_variant(&mut self, v: &Variant, g: &Generics, e: E) {
Expand Down Expand Up @@ -461,8 +461,9 @@ mod svh_visitor {
SawGenerics.hash(self.st); visit::walk_generics(self, g, e)
}

fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span, n: NodeId, e: E) {
SawFn.hash(self.st); visit::walk_fn(self, fk, fd, b, s, n, e)
fn visit_fn(&mut self, fk: &FnKind, fd: &FnDecl, b: &Block, s: Span,
_n: NodeId, e: E) {
SawFn.hash(self.st); visit::walk_fn(self, fk, fd, b, s, e)
}

fn visit_ty_method(&mut self, t: &TypeMethod, e: E) {
Expand Down

1 comment on commit dbd8315

@alexcrichton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ p=10

Please sign in to comment.