diff --git a/pil-analyzer/src/pil_analyzer.rs b/pil-analyzer/src/pil_analyzer.rs index 89341b9772..ce31917243 100644 --- a/pil-analyzer/src/pil_analyzer.rs +++ b/pil-analyzer/src/pil_analyzer.rs @@ -565,6 +565,8 @@ impl Children for PILAnalyzer { self.definitions .values() .filter_map(|(_, def)| def.as_ref()) + // Since TraitFunction definition is already included in the declaration itself, we filter TraitFunctions to avoid duplicates + .filter(|def| !matches!(def, FunctionValueDefinition::TraitFunction(_, _))) .flat_map(|def| def.children()) .chain(self.trait_impls.iter().flat_map(|impl_| impl_.children())) .chain(self.proof_items.iter()), @@ -576,6 +578,8 @@ impl Children for PILAnalyzer { self.definitions .values_mut() .filter_map(|(_, def)| def.as_mut()) + // Since TraitFunction definition is already included in the declaration itself, we filter TraitFunctions to avoid duplicates + .filter(|def| !matches!(def, FunctionValueDefinition::TraitFunction(_, _))) .flat_map(|def| def.children_mut()) .chain( self.trait_impls