rust/src/test
bors 400e955d8b Auto merge of #26199 - swgillespie:issue-26092, r=alexcrichton
`driver::build_output_filenames` calls `file_stem` on a PathBuf obtained from the output file compiler flag. It's possible to pass the empty string to this compiler flag. When file_stem is called on an empty Path, it returns None, which is unwrapped and the compiler panics.

This change modifies the `unwrap` to an `unwrap_or` so that the empty string is passed through the compilation pipeline until it reaches `trans:🔙:write_output_file`, which will emit an appropriate error.

Instead of panicking, the error that is emitted now is:

```
$ rustc -o "" thing.rs
error: could not write output to : No such file or directory
```

The `:` is a little strange, but it /is/ reporting the filename (the empty string) correctly, I suppose. Both gcc and clang hand the output file to ld, which emits a similar error message when faced with the empty string as an output file:

```
$ clang -o "" thing.c
ld: can't open output file for writing: , errno=2 for architecture x86_64
```

This PR also adds a test for this, in `run-make`. This fixes issue #26092.
2015-06-11 21:35:10 +00:00
..
auxiliary
bench Conver reborrows to .iter() calls where appropriate 2015-06-11 13:56:07 +01:00
codegen
compile-fail Auto merge of #26172 - nham:add_E0116, r=alexcrichton 2015-06-11 10:06:38 +00:00
compile-fail-fulldeps
debuginfo
parse-fail
pretty
run-fail
run-fail-fulldeps
run-make fix #26092 by returning an empty OS string when the output file path has no file_stem 2015-06-10 18:18:04 -07:00
run-pass Auto merge of #26190 - Veedrac:no-iter, r=alexcrichton 2015-06-11 18:10:08 +00:00
run-pass-fulldeps Removed many pointless calls to *iter() and iter_mut() 2015-06-10 21:14:03 +01:00
run-pass-valgrind
rustdoc