diff --git a/crates/erg_compiler/build_package.rs b/crates/erg_compiler/build_package.rs index 636280ca..0c46ec8f 100644 --- a/crates/erg_compiler/build_package.rs +++ b/crates/erg_compiler/build_package.rs @@ -418,7 +418,7 @@ impl let res = self.resolve(&mut ast, &cfg); debug_assert!(res.is_ok(), "{:?}", res.unwrap_err()); log!(info "Dependency resolution process completed"); - println!("graph:\n{}", self.shared.graph.display()); + log!("graph:\n{}", self.shared.graph.display()); if self.parse_errors.errors.is_empty() { self.shared.warns.extend(self.parse_errors.warns.flush()); // continue analysis if ELS mode @@ -838,12 +838,9 @@ impl write!(out, "Checking 0/{nmods}").unwrap(); out.flush().unwrap(); } - println!("here?: {path}"); - let mut limit = 100000; while let Some(ancestor) = ancestors.pop() { if graph.ancestors(&ancestor).is_empty() { graph.remove(&ancestor); - limit = 100000; if let Some(entry) = self.asts.remove(&ancestor) { if print_progress { let name = ancestor.file_name().unwrap_or_default().to_string_lossy(); @@ -864,10 +861,6 @@ impl self.build_inlined_module(&ancestor, graph); } } else { - limit -= 1; - if limit == 0 { - panic!("{ancestor} is in a circular dependency"); - } ancestors.insert(0, ancestor); } } @@ -950,7 +943,6 @@ impl } } }; - println!("Start to analyze {path}"); if SINGLE_THREAD { run(); self.shared.promises.mark_as_joined(path); diff --git a/crates/erg_compiler/context/inquire.rs b/crates/erg_compiler/context/inquire.rs index 8c3562a8..30be2cfc 100644 --- a/crates/erg_compiler/context/inquire.rs +++ b/crates/erg_compiler/context/inquire.rs @@ -73,7 +73,7 @@ impl Context { } if self.shared.is_some() && self.promises().is_registered(&path) && !self.mod_cached(&path) { - self.promises().join(&path).unwrap(); + let _result = self.promises().join(&path); } self.opt_mod_cache()? .raw_ref_ctx(&path) diff --git a/crates/erg_compiler/module/cache.rs b/crates/erg_compiler/module/cache.rs index 482b6e74..76fa220f 100644 --- a/crates/erg_compiler/module/cache.rs +++ b/crates/erg_compiler/module/cache.rs @@ -340,7 +340,6 @@ impl SharedModuleCache { where NormalizedPathBuf: Borrow, { - println!("343"); let mut cache = loop { if let Some(cache) = self.0.try_borrow_mut() { break cache; diff --git a/crates/erg_compiler/module/promise.rs b/crates/erg_compiler/module/promise.rs index 92421539..e57b5ea6 100644 --- a/crates/erg_compiler/module/promise.rs +++ b/crates/erg_compiler/module/promise.rs @@ -160,7 +160,6 @@ impl SharedPromises { } pub fn wait_until_finished(&self, path: &NormalizedPathBuf) { - println!("163"); if self.promises.borrow().get(path).is_none() { panic!("not registered: {path}"); } @@ -180,11 +179,9 @@ impl SharedPromises { return Ok(()); } if SINGLE_THREAD { - println!("182: {path}"); assert!(self.is_joined(path)); return Ok(()); } - println!("!?: {path}"); // Suppose A depends on B and C, and B depends on C. // In this case, B must join C before A joins C. Otherwise, a deadlock will occur. let children = self.graph.children(path); @@ -226,14 +223,14 @@ impl SharedPromises { paths.push(path.clone()); } for path in paths { - self.join(&path).unwrap(); + let _result = self.join(&path); } } pub fn join_all(&self) { let paths = self.promises.borrow().keys().cloned().collect::>(); for path in paths { - self.join(&path).unwrap(); + let _result = self.join(&path); } }