File tree 1 file changed +9
-1
lines changed
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> {
332
332
TypeRef :: Macro ( macro_call) => {
333
333
let ( mut expander, recursion_start) = {
334
334
match RefMut :: filter_map ( self . expander . borrow_mut ( ) , Option :: as_mut) {
335
+ // There already is an expander here, this means we are already recursing
335
336
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.
336
339
Err ( expander) => (
337
340
RefMut :: map ( expander, |it| {
338
341
it. insert ( Expander :: new (
@@ -362,9 +365,14 @@ impl<'a> TyLoweringContext<'a> {
362
365
. exit ( self . db . upcast ( ) , mark) ;
363
366
Some ( ty)
364
367
}
365
- _ => None ,
368
+ _ => {
369
+ drop ( expander) ;
370
+ None
371
+ }
366
372
}
367
373
} ;
374
+
375
+ // drop the expander, resetting it to pre-recursion state
368
376
if recursion_start {
369
377
* self . expander . borrow_mut ( ) = None ;
370
378
}
You can’t perform that action at this time.
0 commit comments