Skip to content

Commit 13a2546

Browse files
Tag a bunch of things with inline
1 parent 148a41c commit 13a2546

File tree

1 file changed

+6
-0
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+6
-0
lines changed

compiler/rustc_parse/src/parser/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ impl<'a> Parser<'a> {
449449
parser
450450
}
451451

452+
#[inline]
452453
pub fn recovery(mut self, recovery: Recovery) -> Self {
453454
self.recovery = recovery;
454455
self
@@ -461,6 +462,7 @@ impl<'a> Parser<'a> {
461462
///
462463
/// Technically, this only needs to restrict eager recovery by doing lookahead at more tokens.
463464
/// But making the distinction is very subtle, and simply forbidding all recovery is a lot simpler to uphold.
465+
#[inline]
464466
fn may_recover(&self) -> bool {
465467
matches!(self.recovery, Recovery::Allowed)
466468
}
@@ -542,6 +544,7 @@ impl<'a> Parser<'a> {
542544
///
543545
/// This method will automatically add `tok` to `expected_tokens` if `tok` is not
544546
/// encountered.
547+
#[inline]
545548
fn check(&mut self, tok: &TokenKind) -> bool {
546549
let is_present = self.token == *tok;
547550
if !is_present {
@@ -550,6 +553,7 @@ impl<'a> Parser<'a> {
550553
is_present
551554
}
552555

556+
#[inline]
553557
fn check_noexpect(&self, tok: &TokenKind) -> bool {
554558
self.token == *tok
555559
}
@@ -567,6 +571,7 @@ impl<'a> Parser<'a> {
567571
}
568572

569573
/// Consumes a token 'tok' if it exists. Returns whether the given token was present.
574+
#[inline]
570575
pub fn eat(&mut self, tok: &TokenKind) -> bool {
571576
let is_present = self.check(tok);
572577
if is_present {
@@ -1369,6 +1374,7 @@ impl<'a> Parser<'a> {
13691374
/// Evaluates the closure with restrictions in place.
13701375
///
13711376
/// Afters the closure is evaluated, restrictions are reset.
1377+
#[inline]
13721378
fn with_res<T>(&mut self, res: Restrictions, f: impl FnOnce(&mut Self) -> T) -> T {
13731379
let old = self.restrictions;
13741380
self.restrictions = res;

0 commit comments

Comments
 (0)