Improve the error message when source file cannot be read
Contribution from @look!
This commit is contained in:
parent
f4f10dba29
commit
b6b8880f0e
@ -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!()
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user