diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-05-21 17:47:23 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-05-24 11:49:33 -0700 |
| commit | 24160171e48a277ef71e84e14fbffffe3c81438a (patch) | |
| tree | e4d594acb224da13101b0146d9e785910021f412 /src/libsyntax/ext/base.rs | |
| parent | fc45382c125d940822368e866588568d78551946 (diff) | |
| download | rust-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.rs | 6 |
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 } |
