summary refs log tree commit diff
path: root/src/libsyntax/ext/base.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-05-21 17:47:23 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-05-24 11:49:33 -0700
commit24160171e48a277ef71e84e14fbffffe3c81438a (patch)
treee4d594acb224da13101b0146d9e785910021f412 /src/libsyntax/ext/base.rs
parentfc45382c125d940822368e866588568d78551946 (diff)
downloadrust-24160171e48a277ef71e84e14fbffffe3c81438a.tar.gz
rust-24160171e48a277ef71e84e14fbffffe3c81438a.zip
Tweak macro parse errors when reaching EOF during macro call parse
- Add detail on origin of current parser when reaching EOF and stop
  saying "found <eof>" and point at the end of macro calls
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
Diffstat (limited to 'src/libsyntax/ext/base.rs')
-rw-r--r--src/libsyntax/ext/base.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index f1a20d54065..ef7317e0038 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -850,7 +850,11 @@ impl<'a> ExtCtxt<'a> {
     }
 
     pub fn new_parser_from_tts(&self, tts: &[tokenstream::TokenTree]) -> parser::Parser<'a> {
-        parse::stream_to_parser(self.parse_sess, tts.iter().cloned().collect())
+        parse::stream_to_parser(
+            self.parse_sess,
+            tts.iter().cloned().collect(),
+            Some("macro arguments"),
+        )
     }
     pub fn source_map(&self) -> &'a SourceMap { self.parse_sess.source_map() }
     pub fn parse_sess(&self) -> &'a parse::ParseSess { self.parse_sess }