From 8ac528bed1cc30eabe26a5acc345acd9cbcf7198 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sun, 8 Mar 2015 18:10:33 -0700 Subject: [PATCH] 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 --- src/librustc_driver/driver.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 565782b29e97..13499439f724 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,