Skip to content

Commit 28034bb

Browse files
author
Yuki Okushi
authored
Rollup merge of #104608 - Nilstrieb:fixmed, r=compiler-errors
Cleanup macro matching recovery The retry has been implemented already in #104335. Also removes a `HACK` comment that's not really needed anymore because the "don't recover during macro matching" isn't really a hack but correct behavior.
2 parents 3e937d0 + 825b8db commit 28034bb

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ fn try_match_macro<'matcher, T: Tracker<'matcher>>(
495495
// hacky, but speeds up the `html5ever` benchmark significantly. (Issue
496496
// 68836 suggests a more comprehensive but more complex change to deal with
497497
// this situation.)
498-
// FIXME(Nilstrieb): Stop recovery from happening on this parser and retry later with recovery if the macro failed to match.
499498
let parser = parser_from_cx(sess, arg.clone(), T::recovery());
500499
// Try each arm's matchers.
501500
let mut tt_parser = TtParser::new(name);

compiler/rustc_parse/src/parser/expr.rs

-5
Original file line numberDiff line numberDiff line change
@@ -2078,12 +2078,7 @@ impl<'a> Parser<'a> {
20782078

20792079
if self.token.kind == TokenKind::Semi
20802080
&& matches!(self.token_cursor.frame.delim_sp, Some((Delimiter::Parenthesis, _)))
2081-
// HACK: This is needed so we can detect whether we're inside a macro,
2082-
// where regular assumptions about what tokens can follow other tokens
2083-
// don't necessarily apply.
20842081
&& self.may_recover()
2085-
// FIXME(Nilstrieb): Remove this check once `may_recover` actually stops recovery
2086-
&& self.subparser_name.is_none()
20872082
{
20882083
// It is likely that the closure body is a block but where the
20892084
// braces have been removed. We will recover and eat the next

0 commit comments

Comments
 (0)