| 862 | pub fn debug_label_matches_env(&self) -> bool { |
| 863 | match crate::env_var("IX_KERNEL_DEBUG_CONST") { |
| 864 | Ok(filter) if filter.is_empty() => true, |
| 865 | Ok(filter) => { |
| 866 | self.debug_label.as_ref().is_some_and(|label| label.contains(&filter)) |
| 867 | }, |
| 868 | Err(_) => true, |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | /// Consume one unit of shared recursive fuel. Returns Err if exhausted. |
| 873 | #[inline] |
| 874 | pub fn tick(&mut self) -> Result<(), TcError<M>> { |
| 875 | if self.rec_fuel == 0 { |
| 876 | if crate::env_var("IX_REC_FUEL_DUMP").is_ok() |
| 877 | && self.debug_label_matches_env() |
| 878 | { |
| 879 | log::info!( |
| 880 | "[rec fuel] exhausted const={} depth={} def_eq_depth={} infer_only={} native_reduce={} eager_reduce={}", |
| 881 | self.debug_label.as_deref().unwrap_or("<unknown>"), |
| 882 | self.depth(), |
| 883 | self.def_eq_depth, |
| 884 | self.infer_only, |
| 885 | self.in_native_reduce, |
| 886 | self.eager_reduce |
| 887 | ); |
| 888 | self.dump_hot_misses(); |