about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2015-03-08 18:10:33 -0700
committerRicho Healey <richo@psych0tik.net>2015-03-08 22:21:59 -0700
commit8ac528bed1cc30eabe26a5acc345acd9cbcf7198 (patch)
tree75e9e0027d27fafa7105f300cb0fbe83bbfa3f67
parent668c6474081a10768ef143b9984efcab5376bf68 (diff)
downloadrust-8ac528bed1cc30eabe26a5acc345acd9cbcf7198.tar.gz
rust-8ac528bed1cc30eabe26a5acc345acd9cbcf7198.zip
rustc: Fix an ICE when -o bare-path
rustc will ICE if you specify an outfile path that is bare without a
directory. As a workaround, before this -o ./foo will work
-rw-r--r--src/librustc_driver/driver.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 565782b29e9..13499439f72 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -954,8 +954,11 @@ pub fn build_output_filenames(input: &Input,
             if *odir != None {
                 sess.warn("ignoring --out-dir flag due to -o flag.");
             }
+
+            let cur_dir = Path::new("");
+
             OutputFilenames {
-                out_directory: out_file.parent().unwrap().to_path_buf(),
+                out_directory: out_file.parent().unwrap_or(cur_dir).to_path_buf(),
                 out_filestem: out_file.file_stem().unwrap()
                                       .to_str().unwrap().to_string(),
                 single_output_file: ofile,