@@ -289,6 +289,7 @@ pub(super) fn transcribe<'a>(
289
289
}
290
290
291
291
/// Turn `$(...)*` sequences into tokens.
292
+ #[ inline( always) ] // called once
292
293
fn transcribe_sequence < ' tx , ' itp > (
293
294
tscx : & mut TranscrCtx < ' tx , ' itp > ,
294
295
seq : & mbe:: TokenTree ,
@@ -357,6 +358,7 @@ fn transcribe_sequence<'tx, 'itp>(
357
358
/// producing "xyz", which is bad because it effectively merges tokens.
358
359
/// `Spacing::Alone` is the safer option. Fortunately, `space_between` will avoid
359
360
/// some of the unnecessary whitespace.
361
+ #[ inline( always) ] // called once
360
362
fn transcribe_metavar < ' tx > (
361
363
tscx : & mut TranscrCtx < ' tx , ' _ > ,
362
364
mut sp : Span ,
@@ -492,6 +494,7 @@ fn transcribe_metavar<'tx>(
492
494
}
493
495
494
496
/// Turn `${expr(...)}` metavariable expressionss into tokens.
497
+ #[ inline( always) ] // called once
495
498
fn transcribe_metavar_expr < ' tx > (
496
499
tscx : & mut TranscrCtx < ' tx , ' _ > ,
497
500
dspan : DelimSpan ,
@@ -502,7 +505,7 @@ fn transcribe_metavar_expr<'tx>(
502
505
MetaVarExpr :: Concat ( ref elements) => metavar_expr_concat ( tscx, dspan, elements) ?,
503
506
MetaVarExpr :: Count ( original_ident, depth) => {
504
507
let matched = matched_from_ident ( dcx, original_ident, tscx. interp ) ?;
505
- let count = count_repetitions ( dcx, depth, matched, & tscx. repeats , & dspan) ?;
508
+ let count = count_repetitions ( dcx, depth, matched, & tscx. repeats , dspan) ?;
506
509
TokenTree :: token_alone (
507
510
TokenKind :: lit ( token:: Integer , sym:: integer ( count) , None ) ,
508
511
tscx. visited_dspan ( dspan) ,
@@ -537,6 +540,7 @@ fn transcribe_metavar_expr<'tx>(
537
540
}
538
541
539
542
/// Handle the `${concat(...)}` metavariable expression.
543
+ #[ inline( always) ] // called once
540
544
fn metavar_expr_concat < ' tx > (
541
545
tscx : & mut TranscrCtx < ' tx , ' _ > ,
542
546
dspan : DelimSpan ,
@@ -617,6 +621,7 @@ fn metavar_expr_concat<'tx>(
617
621
/// These are typically used for passing larger amounts of code, and tokens in that code usually
618
622
/// combine with each other and not with tokens outside of the sequence.
619
623
/// - The metavariable span comes from a different crate, then we prefer the more local span.
624
+ #[ inline( always) ] // called once
620
625
fn maybe_use_metavar_location (
621
626
psess : & ParseSess ,
622
627
stack : & [ Frame < ' _ > ] ,
@@ -808,12 +813,13 @@ fn lockstep_iter_size(
808
813
/// * `[ $( ${count(foo, 0)} ),* ]` will be the same as `[ $( ${count(foo)} ),* ]`
809
814
/// * `[ $( ${count(foo, 1)} ),* ]` will return an error because `${count(foo, 1)}` is
810
815
/// declared inside a single repetition and the index `1` implies two nested repetitions.
816
+ #[ inline( always) ] // called once
811
817
fn count_repetitions < ' dx > (
812
818
dcx : DiagCtxtHandle < ' dx > ,
813
819
depth_user : usize ,
814
820
mut matched : & NamedMatch ,
815
821
repeats : & [ ( usize , usize ) ] ,
816
- sp : & DelimSpan ,
822
+ sp : DelimSpan ,
817
823
) -> PResult < ' dx , usize > {
818
824
// Recursively count the number of matches in `matched` at given depth
819
825
// (or at the top-level of `matched` if no depth is given).
0 commit comments