Rollup merge of #21336 - rylev:better-nofile-error, r=brson

Contribution from @look!

Addresses https://github.com/rust-lang/rust/issues/21329
This commit is contained in:
Barosl LEE 2015-01-21 02:16:48 +09:00
commit fa0c2c5e46

View File

@ -253,9 +253,10 @@ pub fn file_to_filemap(sess: &ParseSess, path: &Path, spanopt: Option<Span>)
let bytes = match File::open(path).read_to_end() {
Ok(bytes) => bytes,
Err(e) => {
err(&format!("couldn't read {:?}: {:?}",
let error_msg = e.desc;
err(&format!("couldn't read {:?}: {}",
path.display(),
e)[]);
error_msg)[]);
unreachable!()
}
};