]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/unix/backtrace.rs
Auto merge of #22839 - lifthrasiir:better-backtrace, r=alexcrichton
[rust.git] / src / libstd / sys / unix / backtrace.rs
index 09630f8f584fe7c93c91bbae0fe267ae65faa7ae..3695b615f62b8fe17237684d631f6f9b733bf700 100644 (file)
@@ -84,8 +84,9 @@
 /// all unix platforms we support right now, so it at least gets the job done.
 
 use prelude::v1::*;
+use os::unix::prelude::*;
 
-use ffi::CStr;
+use ffi::{CStr, AsOsStr};
 use old_io::IoResult;
 use libc;
 use mem;
@@ -370,7 +371,7 @@ unsafe fn init_state() -> *mut backtrace_state {
         };
         let filename = match selfname {
             Some(path) => {
-                let bytes = path.as_vec();
+                let bytes = path.as_os_str().as_bytes();
                 if bytes.len() < LAST_FILENAME.len() {
                     let i = bytes.iter();
                     for (slot, val) in LAST_FILENAME.iter_mut().zip(i) {