@@ -289,6 +289,7 @@ pub(super) fn transcribe<'a>(
289289}
290290
291291/// Turn `$(...)*` sequences into tokens.
292+ #[ inline( always) ] // called once
292293fn transcribe_sequence < ' tx , ' itp > (
293294 tscx : & mut TranscrCtx < ' tx , ' itp > ,
294295 seq : & mbe:: TokenTree ,
@@ -357,6 +358,7 @@ fn transcribe_sequence<'tx, 'itp>(
357358/// producing "xyz", which is bad because it effectively merges tokens.
358359/// `Spacing::Alone` is the safer option. Fortunately, `space_between` will avoid
359360/// some of the unnecessary whitespace.
361+ #[ inline( always) ] // called once
360362fn transcribe_metavar < ' tx > (
361363 tscx : & mut TranscrCtx < ' tx , ' _ > ,
362364 mut sp : Span ,
@@ -492,6 +494,7 @@ fn transcribe_metavar<'tx>(
492494}
493495
494496/// Turn `${expr(...)}` metavariable expressionss into tokens.
497+ #[ inline( always) ] // called once
495498fn transcribe_metavar_expr < ' tx > (
496499 tscx : & mut TranscrCtx < ' tx , ' _ > ,
497500 dspan : DelimSpan ,
@@ -502,7 +505,7 @@ fn transcribe_metavar_expr<'tx>(
502505 MetaVarExpr :: Concat ( ref elements) => metavar_expr_concat ( tscx, dspan, elements) ?,
503506 MetaVarExpr :: Count ( original_ident, depth) => {
504507 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) ?;
506509 TokenTree :: token_alone (
507510 TokenKind :: lit ( token:: Integer , sym:: integer ( count) , None ) ,
508511 tscx. visited_dspan ( dspan) ,
@@ -537,6 +540,7 @@ fn transcribe_metavar_expr<'tx>(
537540}
538541
539542/// Handle the `${concat(...)}` metavariable expression.
543+ #[ inline( always) ] // called once
540544fn metavar_expr_concat < ' tx > (
541545 tscx : & mut TranscrCtx < ' tx , ' _ > ,
542546 dspan : DelimSpan ,
@@ -617,6 +621,7 @@ fn metavar_expr_concat<'tx>(
617621/// These are typically used for passing larger amounts of code, and tokens in that code usually
618622/// combine with each other and not with tokens outside of the sequence.
619623/// - The metavariable span comes from a different crate, then we prefer the more local span.
624+ #[ inline( always) ] // called once
620625fn maybe_use_metavar_location (
621626 psess : & ParseSess ,
622627 stack : & [ Frame < ' _ > ] ,
@@ -808,12 +813,13 @@ fn lockstep_iter_size(
808813/// * `[ $( ${count(foo, 0)} ),* ]` will be the same as `[ $( ${count(foo)} ),* ]`
809814/// * `[ $( ${count(foo, 1)} ),* ]` will return an error because `${count(foo, 1)}` is
810815/// declared inside a single repetition and the index `1` implies two nested repetitions.
816+ #[ inline( always) ] // called once
811817fn count_repetitions < ' dx > (
812818 dcx : DiagCtxtHandle < ' dx > ,
813819 depth_user : usize ,
814820 mut matched : & NamedMatch ,
815821 repeats : & [ ( usize , usize ) ] ,
816- sp : & DelimSpan ,
822+ sp : DelimSpan ,
817823) -> PResult < ' dx , usize > {
818824 // Recursively count the number of matches in `matched` at given depth
819825 // (or at the top-level of `matched` if no depth is given).
0 commit comments