@@ -70,6 +70,7 @@ struct TranscrCtx<'psess, 'itp> {
70
70
71
71
impl < ' psess > TranscrCtx < ' psess , ' _ > {
72
72
/// Span marked with the correct expansion and transparency.
73
+ #[ inline( always) ]
73
74
fn visited_dspan ( & mut self , dspan : DelimSpan ) -> Span {
74
75
let mut span = dspan. entire ( ) ;
75
76
self . marker . mark_span ( & mut span) ;
@@ -86,6 +87,7 @@ struct Marker {
86
87
87
88
impl Marker {
88
89
/// Mark a span with the stored expansion ID and transparency.
90
+ #[ inline( always) ]
89
91
fn mark_span ( & mut self , span : & mut Span ) {
90
92
// `apply_mark` is a relatively expensive operation, both due to taking hygiene lock, and
91
93
// by itself. All tokens in a macro body typically have the same syntactic context, unless
@@ -113,6 +115,7 @@ enum FrameKind {
113
115
}
114
116
115
117
impl < ' a > Frame < ' a > {
118
+ #[ inline( always) ]
116
119
fn new_delimited ( src : & ' a mbe:: Delimited , span : DelimSpan , spacing : DelimSpacing ) -> Frame < ' a > {
117
120
Frame {
118
121
tts : & src. tts ,
@@ -121,6 +124,7 @@ impl<'a> Frame<'a> {
121
124
}
122
125
}
123
126
127
+ #[ inline( always) ]
124
128
fn new_sequence (
125
129
src : & ' a mbe:: SequenceRepetition ,
126
130
sep : Option < Token > ,
@@ -133,6 +137,7 @@ impl<'a> Frame<'a> {
133
137
impl < ' a > Iterator for Frame < ' a > {
134
138
type Item = & ' a mbe:: TokenTree ;
135
139
140
+ #[ inline( always) ]
136
141
fn next ( & mut self ) -> Option < & ' a mbe:: TokenTree > {
137
142
let res = self . tts . get ( self . idx ) ;
138
143
self . idx += 1 ;
@@ -687,6 +692,7 @@ fn maybe_use_metavar_location(
687
692
/// See the definition of `repeats` in the `transcribe` function. `repeats` is used to descend
688
693
/// into the right place in nested matchers. If we attempt to descend too far, the macro writer has
689
694
/// made a mistake, and we return `None`.
695
+ #[ inline( always) ]
690
696
fn lookup_cur_matched < ' a > (
691
697
ident : MacroRulesNormalizedIdent ,
692
698
interpolations : & ' a FxHashMap < MacroRulesNormalizedIdent , NamedMatch > ,
@@ -727,6 +733,7 @@ impl LockstepIterSize {
727
733
/// - `Unconstrained` is compatible with everything.
728
734
/// - `Contradiction` is incompatible with everything.
729
735
/// - `Constraint(len)` is only compatible with other constraints of the same length.
736
+ #[ inline( always) ]
730
737
fn with ( self , other : LockstepIterSize ) -> LockstepIterSize {
731
738
match self {
732
739
LockstepIterSize :: Unconstrained => other,
@@ -764,6 +771,7 @@ impl LockstepIterSize {
764
771
/// declared at depths which weren't equal or there was a compiler bug. For example, if we have 3 repetitions of
765
772
/// the outer sequence and 4 repetitions of the inner sequence for `x`, we should have the same for
766
773
/// `y`; otherwise, we can't transcribe them both at the given depth.
774
+ #[ inline( always) ]
767
775
fn lockstep_iter_size (
768
776
tree : & mbe:: TokenTree ,
769
777
interpolations : & FxHashMap < MacroRulesNormalizedIdent , NamedMatch > ,
@@ -875,6 +883,7 @@ fn count_repetitions<'dx>(
875
883
}
876
884
877
885
/// Returns a `NamedMatch` item declared on the LHS given an arbitrary [Ident]
886
+ #[ inline( always) ]
878
887
fn matched_from_ident < ' ctx , ' interp , ' rslt > (
879
888
dcx : DiagCtxtHandle < ' ctx > ,
880
889
ident : Ident ,
@@ -906,6 +915,7 @@ fn out_of_bounds_err<'a>(dcx: DiagCtxtHandle<'a>, max: usize, span: Span, ty: &s
906
915
}
907
916
908
917
/// Extracts an metavariable symbol that can be an identifier, a token tree or a literal.
918
+ #[ inline( always) ]
909
919
fn extract_symbol_from_pnr < ' a > (
910
920
dcx : DiagCtxtHandle < ' a > ,
911
921
pnr : & ParseNtResult ,
0 commit comments