about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorAxary <bastian_kauschke@hotmail.de>2018-11-16 18:43:06 +0100
committerAxary <bastian_kauschke@hotmail.de>2018-11-16 18:43:06 +0100
commit646d68f585e6cbabba5b7a67665af9a1f83ea6ea (patch)
tree588ccf9aef4bdc3cdf828aab56b4d851492aecfc /src/libsyntax/parse/parser.rs
parent4c4aff9b3d1734a1dfb127ce8732728edc5b39ed (diff)
downloadrust-646d68f585e6cbabba5b7a67665af9a1f83ea6ea.tar.gz
rust-646d68f585e6cbabba5b7a67665af9a1f83ea6ea.zip
add a note to the error message
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index dd1864ce124..7ddb4099e0e 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5388,7 +5388,10 @@ impl<'a> Parser<'a> {
         self.expect(&token::OpenDelim(token::Paren))?;
 
         if let Ok(Some(_)) = self.parse_self_arg() {
-            return Err(self.fatal("unexpected `self` argument in bare function"))
+            let mut err = self.struct_span_err(self.prev_span
+                , "unexpected `self` argument in bare function");
+            err.span_label(self.prev_span, "invalid argument in bare function");
+            return Err(err);
         }
 
         let sp = self.span;