diff options
| author | Barosl LEE <github@barosl.com> | 2015-01-21 02:16:48 +0900 |
|---|---|---|
| committer | Barosl LEE <github@barosl.com> | 2015-01-21 02:16:48 +0900 |
| commit | fa0c2c5e4677ca7b905ffaf5b85772db6cd5c260 (patch) | |
| tree | 154961f3af46c35b8e3d2660cedf905917a8ca19 /src/libsyntax | |
| parent | efa8360f98605be755ca0647a6fd5b98bc66e0af (diff) | |
| parent | b6b8880f0ec3f057dc56320f6886be173a8f0d8e (diff) | |
| download | rust-fa0c2c5e4677ca7b905ffaf5b85772db6cd5c260.tar.gz rust-fa0c2c5e4677ca7b905ffaf5b85772db6cd5c260.zip | |
Rollup merge of #21336 - rylev:better-nofile-error, r=brson
Contribution from @look! Addresses https://github.com/rust-lang/rust/issues/21329
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 90e236dfde3..8a5a0b0fce7 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -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!() } }; |
