rustc_parse: Make Parser::unexpected public and use it in built-in macros

This commit is contained in:
Vadim Petrochenkov 2020-10-06 00:21:03 +03:00
parent 299136b9c7
commit 219c66c55c
3 changed files with 4 additions and 5 deletions

View file

@ -120,8 +120,7 @@ fn parse_assert<'a>(
};
if parser.token != token::Eof {
parser.expect_one_of(&[], &[])?;
unreachable!();
return parser.unexpected();
}
Ok(Assert { cond_expr, custom_message })