diff options
| author | MaulingMonkey <git@maulingmonkey.com> | 2017-07-20 16:09:24 -0700 |
|---|---|---|
| committer | MaulingMonkey <git@maulingmonkey.com> | 2017-07-20 16:09:24 -0700 |
| commit | 65b7908e109c05f5808971e6ceaee22eceb7db7d (patch) | |
| tree | 0670945f667f646b4dd01096af76a30dd0fcee1b /src | |
| parent | cfc128cea4d10827be2178bac66dc23888c02092 (diff) | |
| download | rust-65b7908e109c05f5808971e6ceaee22eceb7db7d.tar.gz rust-65b7908e109c05f5808971e6ceaee22eceb7db7d.zip | |
Handle unicode natvis paths, simplify extension check to a single if.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trans/back/linker.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/librustc_trans/back/linker.rs b/src/librustc_trans/back/linker.rs index 0afb354185c..d3f2d5923a3 100644 --- a/src/librustc_trans/back/linker.rs +++ b/src/librustc_trans/back/linker.rs @@ -484,14 +484,10 @@ impl<'a> Linker for MsvcLinker<'a> { match entry { Ok(entry) => { let path = entry.path(); - if let Some(ext) = path.extension() { - if ext == OsStr::new("natvis") { - if let Some(natvis_path_str) = path.to_str() { - self.cmd.arg(&format!("/NATVIS:{}",natvis_path_str)); - } else { - self.sess.warn(&format!("natvis path not unicode: {:?}", path)); - } - } + if path.extension() == Some("natvis".as_ref()) { + let mut arg = OsString::from("/NATVIS:"); + arg.push(path); + self.cmd.arg(arg); } }, Err(err) => { |
