From f0507ab7c697ba4bcd59dd2f673dfff5072e3e1a Mon Sep 17 00:00:00 2001 From: cynecx Date: Sun, 18 Apr 2021 20:18:48 +0200 Subject: hir_ty: cleanups and extend infinitely_recursive_macro_type test --- crates/hir_ty/src/lower.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/lower.rs') diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index a883334af..7fd46becd 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -296,9 +296,11 @@ impl<'a> TyLoweringContext<'a> { } } TypeRef::Macro(macro_call) => { - let (expander, recursion_start) = match self.expander.borrow_mut() { - expander if expander.is_some() => (Some(expander), false), - mut expander => { + let (expander, recursion_start) = { + let mut expander = self.expander.borrow_mut(); + if expander.is_some() { + (Some(expander), false) + } else { if let Some(module_id) = self.resolver.module() { *expander = Some(Expander::new( self.db.upcast(), -- cgit v1.2.3