From 031633fe6fa8439c5f0e3afb228a7ef0e94be167 Mon Sep 17 00:00:00 2001 From: Lucas Franceschino Date: Wed, 31 Jan 2024 14:43:15 +0100 Subject: [PATCH] fix(engine/deps): fix inverted behavior for including dependencies I introduced a bug in https://github.com/hacspec/hax/pull/470: a negative `-i` clause would drop not only the matching items but any items they rely on! This resulted in an extremely confusing behavior... --- engine/lib/dependencies.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/lib/dependencies.ml b/engine/lib/dependencies.ml index d4497dc02..dfb956118 100644 --- a/engine/lib/dependencies.ml +++ b/engine/lib/dependencies.ml @@ -255,11 +255,11 @@ module Make (F : Features.T) = struct let apply_clause selection' (clause : Types.inclusion_clause) = let matches = Concrete_ident.matches_namespace clause.Types.namespace in let matched = Set.filter ~f:matches selection in - let without_deps = - [%matches? (Included { strict = true } : Types.inclusion_kind)] + let with_deps = + [%matches? (Included { strict = false } : Types.inclusion_kind)] clause.kind in - let matched = matched |> if without_deps then Fn.id else deps_of in + let matched = matched |> if with_deps then deps_of else Fn.id in Logs.info (fun m -> m "The clause [%s] will %s the following Rust items:\n%s" (show_inclusion_clause clause)