aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lower.rs
diff options
context:
space:
mode:
authorcynecx <[email protected]>2021-04-18 19:18:48 +0100
committercynecx <[email protected]>2021-04-18 19:18:48 +0100
commitf0507ab7c697ba4bcd59dd2f673dfff5072e3e1a (patch)
treec7d98c642ea0ead859ed143b02bd9916da4fabf8 /crates/hir_ty/src/lower.rs
parent6ed2fd233b569d01169fc888f30c358dd289d260 (diff)
hir_ty: cleanups and extend infinitely_recursive_macro_type test
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r--crates/hir_ty/src/lower.rs8
1 files changed, 5 insertions, 3 deletions
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> {
296 } 296 }
297 } 297 }
298 TypeRef::Macro(macro_call) => { 298 TypeRef::Macro(macro_call) => {
299 let (expander, recursion_start) = match self.expander.borrow_mut() { 299 let (expander, recursion_start) = {
300 expander if expander.is_some() => (Some(expander), false), 300 let mut expander = self.expander.borrow_mut();
301 mut expander => { 301 if expander.is_some() {
302 (Some(expander), false)
303 } else {
302 if let Some(module_id) = self.resolver.module() { 304 if let Some(module_id) = self.resolver.module() {
303 *expander = Some(Expander::new( 305 *expander = Some(Expander::new(
304 self.db.upcast(), 306 self.db.upcast(),