Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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