From a04117f9557cd54c322b18de46a1580ebb1ac79e Mon Sep 17 00:00:00 2001 From: edef Date: Thu, 16 Apr 2015 02:08:41 -0400 Subject: [PATCH] use Display for displaying IoErrors --- src/os.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os.rs b/src/os.rs index 06860c3..2785db0 100644 --- a/src/os.rs +++ b/src/os.rs @@ -49,7 +49,7 @@ impl Stack { let stack = unsafe { let ptr = match sys::map_stack(size) { None => { - panic!("mmap for stack of size {} failed: {:?}", + panic!("mmap for stack of size {} failed: {}", len, IoError::last_os_error()) } Some(ptr) => ptr @@ -64,7 +64,7 @@ impl Stack { unsafe { if !sys::protect_stack(stack.ptr) { - panic!("mprotect for guard page of stack {:p} failed: {:?}", + panic!("mprotect for guard page of stack {:p} failed: {}", stack.ptr, IoError::last_os_error()); } } @@ -78,7 +78,7 @@ impl Drop for Stack { unsafe { valgrind::stack_deregister(self.valgrind_id); if !sys::unmap_stack(self.ptr, self.len) { - panic!("munmap for stack {:p} of size {} failed: {:?}", + panic!("munmap for stack {:p} of size {} failed: {}", self.ptr, self.len, IoError::last_os_error()) } }