1
Fork 0

replace parse_lifetime with expect_lifetime

made `parser::Parser::expect_lifetime` public, so it can be called from `macro_parser::parse_nt`
This commit is contained in:
Michael Hewson 2017-05-11 22:59:48 +00:00 committed by Matt Peterson
parent 03a51019a4
commit e12b87096a
2 changed files with 2 additions and 2 deletions

View file

@ -603,7 +603,7 @@ fn parse_nt<'a>(p: &mut Parser<'a>, sp: Span, name: &str) -> Nonterminal {
"path" => token::NtPath(panictry!(p.parse_path_common(PathStyle::Type, false))),
"meta" => token::NtMeta(panictry!(p.parse_meta_item())),
"vis" => token::NtVis(panictry!(p.parse_visibility(true))),
"lifetime" => token::NtLifetime(panictry!(p.parse_lifetime())),
"lifetime" => token::NtLifetime(p.expect_lifetime()),
// this is not supposed to happen, since it has been checked
// when compiling the macro.
_ => p.span_bug(sp, "invalid fragment specifier")