Skip to content

Commit 65b7908

Browse files
committed
Handle unicode natvis paths, simplify extension check to a single if.
1 parent cfc128c commit 65b7908

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/librustc_trans/back/linker.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,10 @@ impl<'a> Linker for MsvcLinker<'a> {
484484
match entry {
485485
Ok(entry) => {
486486
let path = entry.path();
487-
if let Some(ext) = path.extension() {
488-
if ext == OsStr::new("natvis") {
489-
if let Some(natvis_path_str) = path.to_str() {
490-
self.cmd.arg(&format!("/NATVIS:{}",natvis_path_str));
491-
} else {
492-
self.sess.warn(&format!("natvis path not unicode: {:?}", path));
493-
}
494-
}
487+
if path.extension() == Some("natvis".as_ref()) {
488+
let mut arg = OsString::from("/NATVIS:");
489+
arg.push(path);
490+
self.cmd.arg(arg);
495491
}
496492
},
497493
Err(err) => {

0 commit comments

Comments
 (0)