about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-09-29 18:34:49 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-09-29 18:34:49 +0200
commit322e46916e8251821543769ada7e38d6e4532da4 (patch)
tree11f1307a53a8d2896e4618d28367928d26688e1e /src/libsyntax/parse
parentf7240e1c74fd19d09e183cedc7dd569c59a4bbd5 (diff)
downloadrust-322e46916e8251821543769ada7e38d6e4532da4.tar.gz
rust-322e46916e8251821543769ada7e38d6e4532da4.zip
Add a sentence before rustc errors
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 7132dc342d2..a814c88ee78 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -240,9 +240,11 @@ impl<'a> StringReader<'a> {
 
     pub fn new_without_err(sess: &'a ParseSess,
                            source_file: Lrc<syntax_pos::SourceFile>,
-                           override_span: Option<Span>) -> Result<Self, ()> {
+                           override_span: Option<Span>,
+                           prepend_error_text: &str) -> Result<Self, ()> {
         let mut sr = StringReader::new_raw(sess, source_file, override_span);
         if sr.advance_token().is_err() {
+            eprintln!("{}", prepend_error_text);
             sr.emit_fatal_errors();
             return Err(());
         }