From d2b9bbbf783e2921fbca28eae06314e8b7f8a89a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 20 Apr 2022 14:13:49 +1000 Subject: [PATCH] Inline `Parser::nonterminal_may_begin_with`. --- compiler/rustc_parse/src/parser/nonterminal.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_parse/src/parser/nonterminal.rs b/compiler/rustc_parse/src/parser/nonterminal.rs index c5caa3ea636..691bfdb01a4 100644 --- a/compiler/rustc_parse/src/parser/nonterminal.rs +++ b/compiler/rustc_parse/src/parser/nonterminal.rs @@ -11,8 +11,10 @@ use crate::parser::{FollowedByType, ForceCollect, NtOrTt, Parser, PathStyle}; impl<'a> Parser<'a> { /// Checks whether a non-terminal may begin with a particular token. /// - /// Returning `false` is a *stability guarantee* that such a matcher will *never* begin with that - /// token. Be conservative (return true) if not sure. + /// Returning `false` is a *stability guarantee* that such a matcher will *never* begin with + /// that token. Be conservative (return true) if not sure. Inlined because it has a single call + /// site. + #[inline] pub fn nonterminal_may_begin_with(kind: NonterminalKind, token: &Token) -> bool { /// Checks whether the non-terminal may contain a single (non-keyword) identifier. fn may_be_ident(nt: &token::Nonterminal) -> bool {