File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,10 @@ impl<'a> TyLoweringContext<'a> {
332332 TypeRef :: Macro ( macro_call) => {
333333 let ( mut expander, recursion_start) = {
334334 match RefMut :: filter_map ( self . expander . borrow_mut ( ) , Option :: as_mut) {
335+ // There already is an expander here, this means we are already recursing
335336 Ok ( expander) => ( expander, false ) ,
337+ // No expander was created yet, so we are at the start of the expansion recursion
338+ // and therefore have to create an expander.
336339 Err ( expander) => (
337340 RefMut :: map ( expander, |it| {
338341 it. insert ( Expander :: new (
@@ -362,9 +365,14 @@ impl<'a> TyLoweringContext<'a> {
362365 . exit ( self . db . upcast ( ) , mark) ;
363366 Some ( ty)
364367 }
365- _ => None ,
368+ _ => {
369+ drop ( expander) ;
370+ None
371+ }
366372 }
367373 } ;
374+
375+ // drop the expander, resetting it to pre-recursion state
368376 if recursion_start {
369377 * self . expander . borrow_mut ( ) = None ;
370378 }
You can’t perform that action at this time.
0 commit comments