File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,14 @@ impl HygieneData {
243
243
* ctxt = self . prev_ctxt ( * ctxt) ;
244
244
outer_mark
245
245
}
246
+
247
+ fn adjust ( & self , ctxt : & mut SyntaxContext , expansion : Mark ) -> Option < Mark > {
248
+ let mut scope = None ;
249
+ while !self . is_descendant_of ( expansion, self . outer ( * ctxt) ) {
250
+ scope = Some ( self . remove_mark ( ctxt) ) ;
251
+ }
252
+ scope
253
+ }
246
254
}
247
255
248
256
pub fn clear_markings ( ) {
@@ -455,11 +463,7 @@ impl SyntaxContext {
455
463
/// This returns the expansion whose definition scope we use to privacy check the resolution,
456
464
/// or `None` if we privacy check as usual (i.e., not w.r.t. a macro definition scope).
457
465
pub fn adjust ( & mut self , expansion : Mark ) -> Option < Mark > {
458
- let mut scope = None ;
459
- while !expansion. outer_is_descendant_of ( * self ) {
460
- scope = Some ( self . remove_mark ( ) ) ;
461
- }
462
- scope
466
+ HygieneData :: with ( |data| data. adjust ( self , expansion) )
463
467
}
464
468
465
469
/// Adjust this context for resolution in a scope created by the given expansion
You can’t perform that action at this time.
0 commit comments