Skip to content

Commit

Permalink
Merge pull request #21336 from rylev/better-nofile-error
Browse files Browse the repository at this point in the history
Improve the error message when source file cannot be read

Reviewed-by: brson
  • Loading branch information
bors committed Jan 18, 2015
2 parents a3f3bb7 + b6b8880 commit 2a243da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsyntax/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
}
};
Expand Down

0 comments on commit 2a243da

Please sign in to comment.