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 {
243243 * ctxt = self . prev_ctxt ( * ctxt) ;
244244 outer_mark
245245 }
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+ }
246254}
247255
248256pub fn clear_markings ( ) {
@@ -455,11 +463,7 @@ impl SyntaxContext {
455463 /// This returns the expansion whose definition scope we use to privacy check the resolution,
456464 /// or `None` if we privacy check as usual (i.e., not w.r.t. a macro definition scope).
457465 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) )
463467 }
464468
465469 /// 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