mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-27 18:55:47 +00:00
Fail slightly more gracefully when given an -o filename that doesn't have an extension
This commit is contained in:
@@ -445,7 +445,10 @@ fn build_link_meta(sess: session, c: ast::crate, output: str,
|
||||
let name =
|
||||
{
|
||||
let os = str::split(fs::basename(output), '.' as u8);
|
||||
assert (vec::len(os) >= 2u);
|
||||
if (vec::len(os) < 2u) {
|
||||
sess.fatal(#fmt("Output file name %s doesn't\
|
||||
appear to have an extension", output));
|
||||
}
|
||||
vec::pop(os);
|
||||
str::connect(os, ".")
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user