@@ -244,6 +244,19 @@ impl HygieneData {
244
244
outer_mark
245
245
}
246
246
247
+ fn marks ( & self , mut ctxt : SyntaxContext ) -> Vec < ( Mark , Transparency ) > {
248
+ let mut marks = Vec :: new ( ) ;
249
+ while ctxt != SyntaxContext :: empty ( ) {
250
+ let outer_mark = self . outer ( ctxt) ;
251
+ let transparency = self . transparency ( ctxt) ;
252
+ let prev_ctxt = self . prev_ctxt ( ctxt) ;
253
+ marks. push ( ( outer_mark, transparency) ) ;
254
+ ctxt = prev_ctxt;
255
+ }
256
+ marks. reverse ( ) ;
257
+ marks
258
+ }
259
+
247
260
fn adjust ( & self , ctxt : & mut SyntaxContext , expansion : Mark ) -> Option < Mark > {
248
261
let mut scope = None ;
249
262
while !self . is_descendant_of ( expansion, self . outer ( * ctxt) ) {
@@ -423,19 +436,8 @@ impl SyntaxContext {
423
436
HygieneData :: with ( |data| data. remove_mark ( self ) )
424
437
}
425
438
426
- pub fn marks ( mut self ) -> Vec < ( Mark , Transparency ) > {
427
- HygieneData :: with ( |data| {
428
- let mut marks = Vec :: new ( ) ;
429
- while self != SyntaxContext :: empty ( ) {
430
- let outer_mark = data. outer ( self ) ;
431
- let transparency = data. transparency ( self ) ;
432
- let prev_ctxt = data. prev_ctxt ( self ) ;
433
- marks. push ( ( outer_mark, transparency) ) ;
434
- self = prev_ctxt;
435
- }
436
- marks. reverse ( ) ;
437
- marks
438
- } )
439
+ pub fn marks ( self ) -> Vec < ( Mark , Transparency ) > {
440
+ HygieneData :: with ( |data| data. marks ( self ) )
439
441
}
440
442
441
443
/// Adjust this context for resolution in a scope created by the given expansion.
0 commit comments