about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-31 03:22:39 +0000
committerbors <bors@rust-lang.org>2017-03-31 03:22:39 +0000
commit474f7a91eec8cba83b7eb7a578a7adb70614f877 (patch)
tree0983a20b40e3743662ace1ae7ec6d0bc901e9990 /src/libstd/sys_common
parent5c94997b6b1cca3e65ecfc5ba40c033d6838019b (diff)
parentb3763862280946cab09cbedc4ad5626ebd95a5b2 (diff)
downloadrust-474f7a91eec8cba83b7eb7a578a7adb70614f877.tar.gz
rust-474f7a91eec8cba83b7eb7a578a7adb70614f877.zip
Auto merge of #40620 - laumann:slash-in-diagnostics-path, r=BurntSushi
Replace hardcoded forward slash with path::MAIN_SEPARATOR

Fixes #40149
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/backtrace.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys_common/backtrace.rs b/src/libstd/sys_common/backtrace.rs
index 99297b781e4..f5c188f7a75 100644
--- a/src/libstd/sys_common/backtrace.rs
+++ b/src/libstd/sys_common/backtrace.rs
@@ -19,7 +19,7 @@ use io;
 use libc;
 use str;
 use sync::atomic::{self, Ordering};
-use path::Path;
+use path::{self, Path};
 use sys::mutex::Mutex;
 use ptr;
 
@@ -262,7 +262,7 @@ fn output_fileline(w: &mut Write, file: &[u8], line: libc::c_int,
         if let Ok(cwd) = env::current_dir() {
             if let Ok(stripped) = file_path.strip_prefix(&cwd) {
                 if let Some(s) = stripped.to_str() {
-                    write!(w, "  at ./{}:{}", s, line)?;
+                    write!(w, "  at .{}{}:{}", path::MAIN_SEPARATOR, s, line)?;
                     already_printed = true;
                 }
             }