@@ -77,7 +77,6 @@ use crate::mbe::{KleeneOp, TokenTree};
77
77
78
78
use rustc_ast:: token:: { self , DocComment , Nonterminal , NonterminalKind , Token } ;
79
79
use rustc_parse:: parser:: { NtOrTt , Parser } ;
80
- use rustc_session:: parse:: ParseSess ;
81
80
use rustc_span:: symbol:: MacroRulesNormalizedIdent ;
82
81
use rustc_span:: Span ;
83
82
@@ -128,9 +127,8 @@ pub(super) enum MatcherLoc {
128
127
Eof ,
129
128
}
130
129
131
- pub ( super ) fn compute_locs ( sess : & ParseSess , matcher : & [ TokenTree ] ) -> Vec < MatcherLoc > {
130
+ pub ( super ) fn compute_locs ( matcher : & [ TokenTree ] ) -> Vec < MatcherLoc > {
132
131
fn inner (
133
- sess : & ParseSess ,
134
132
tts : & [ TokenTree ] ,
135
133
locs : & mut Vec < MatcherLoc > ,
136
134
next_metavar : & mut usize ,
@@ -147,7 +145,7 @@ pub(super) fn compute_locs(sess: &ParseSess, matcher: &[TokenTree]) -> Vec<Match
147
145
148
146
locs. push ( MatcherLoc :: Delimited ) ;
149
147
locs. push ( MatcherLoc :: Token { token : open_token } ) ;
150
- inner ( sess , & delimited. tts , locs, next_metavar, seq_depth) ;
148
+ inner ( & delimited. tts , locs, next_metavar, seq_depth) ;
151
149
locs. push ( MatcherLoc :: Token { token : close_token } ) ;
152
150
}
153
151
TokenTree :: Sequence ( _, seq) => {
@@ -162,7 +160,7 @@ pub(super) fn compute_locs(sess: &ParseSess, matcher: &[TokenTree]) -> Vec<Match
162
160
let op = seq. kleene . op ;
163
161
let idx_first = locs. len ( ) ;
164
162
let idx_seq = idx_first - 1 ;
165
- inner ( sess , & seq. tts , locs, next_metavar, seq_depth + 1 ) ;
163
+ inner ( & seq. tts , locs, next_metavar, seq_depth + 1 ) ;
166
164
167
165
if let Some ( separator) = & seq. separator {
168
166
locs. push ( MatcherLoc :: SequenceSep { separator : separator. clone ( ) } ) ;
@@ -197,7 +195,7 @@ pub(super) fn compute_locs(sess: &ParseSess, matcher: &[TokenTree]) -> Vec<Match
197
195
198
196
let mut locs = vec ! [ ] ;
199
197
let mut next_metavar = 0 ;
200
- inner ( sess , matcher, & mut locs, & mut next_metavar, /* seq_depth */ 0 ) ;
198
+ inner ( matcher, & mut locs, & mut next_metavar, /* seq_depth */ 0 ) ;
201
199
202
200
// A final entry is needed for eof.
203
201
locs. push ( MatcherLoc :: Eof ) ;
0 commit comments