Skip to content

Commit

Permalink
rollup merge of rust-lang#27674: zaeleus/ios-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Aug 12, 2015
2 parents d4f2ef9 + 8f4aee8 commit 00ac2c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libstd/rand/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ mod imp {

#[cfg(target_os = "ios")]
mod imp {
use prelude::v1::*;
#[cfg(stage0)] use prelude::v1::*;

use io;
use mem;
use rand::Rng;
use libc::{c_int, c_void, size_t};
use libc::{c_int, size_t};

/// A random number generator that retrieves randomness straight from
/// the operating system. Platform sources:
Expand Down
4 changes: 3 additions & 1 deletion src/libstd/sys/unix/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ use sys_common::backtrace::*;
#[cfg(all(target_os = "ios", target_arch = "arm"))]
#[inline(never)]
pub fn write(w: &mut Write) -> io::Result<()> {
use mem;

extern {
fn backtrace(buf: *mut *mut libc::c_void,
sz: libc::c_int) -> libc::c_int;
Expand All @@ -121,7 +123,7 @@ pub fn write(w: &mut Write) -> io::Result<()> {
try!(writeln!(w, "stack backtrace:"));
// 100 lines should be enough
const SIZE: usize = 100;
let mut buf: [*mut libc::c_void; SIZE] = unsafe {mem::zeroed()};
let mut buf: [*mut libc::c_void; SIZE] = unsafe { mem::zeroed() };
let cnt = unsafe { backtrace(buf.as_mut_ptr(), SIZE as libc::c_int) as usize};

// skipping the first one as it is write itself
Expand Down

0 comments on commit 00ac2c0

Please sign in to comment.