From 2287b376a870218890a7bacf877fb037c767e37c Mon Sep 17 00:00:00 2001 From: Maxime Arthaud Date: Sat, 19 Sep 2026 09:30:10 +0200 Subject: [PATCH] Fix build warnings in the rust crate Summary: A clean `cargo build` raises four warnings: - `hash_set_impl` only contains trait impls, so the `pub use hash_set_impl::*;` re-export brings in no names and triggers `unused_imports`. The `mod` declaration is kept so the impls stay in the crate. - `PatriciaTree::iter` and the two `ReverseGraph::rev` signatures elide a lifetime on `&self` while hiding it in the return type, which triggers `mismatched_lifetime_syntaxes`. Spell the hidden lifetime as `'_`. No behavior change; `cargo build --all-targets` is now warning free and all tests pass. Co-Authored-By: Claude Opus 5 --- rust/src/datatype/mod.rs | 1 - rust/src/datatype/patricia_tree_impl.rs | 2 +- rust/src/graph.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/src/datatype/mod.rs b/rust/src/datatype/mod.rs index acc3b0d..290c812 100644 --- a/rust/src/datatype/mod.rs +++ b/rust/src/datatype/mod.rs @@ -20,7 +20,6 @@ pub use abstract_domain::*; pub use abstract_environment::*; pub use abstract_partition::*; pub use bitvec::*; -pub use hash_set_impl::*; pub use lifted_domain::*; pub use patricia_tree_map::*; pub use patricia_tree_set::*; diff --git a/rust/src/datatype/patricia_tree_impl.rs b/rust/src/datatype/patricia_tree_impl.rs index 1831a13..ea439b3 100644 --- a/rust/src/datatype/patricia_tree_impl.rs +++ b/rust/src/datatype/patricia_tree_impl.rs @@ -799,7 +799,7 @@ impl PatriciaTree { self.update_by_key(key, |_| None); } - pub(crate) fn iter(&self) -> PatriciaTreePostOrderIterator { + pub(crate) fn iter(&self) -> PatriciaTreePostOrderIterator<'_, V> { PatriciaTreePostOrderIterator::::from_tree(self) } diff --git a/rust/src/graph.rs b/rust/src/graph.rs index f0b6fac..3830935 100644 --- a/rust/src/graph.rs +++ b/rust/src/graph.rs @@ -96,7 +96,7 @@ pub trait ReverseGraph { type G: Graph; /// Reversed graph. - fn rev(&self) -> ReversedRefGraph; + fn rev(&self) -> ReversedRefGraph<'_, Self::G, S>; /// Reversed graph that consumes the original graph. fn into_rev(self) -> ReversedIntoGraph; @@ -109,7 +109,7 @@ pub trait ReverseGraph { impl> ReverseGraph for T { type G = T; - fn rev(&self) -> ReversedRefGraph { + fn rev(&self) -> ReversedRefGraph<'_, T, S> { ReversedGraph { graph: self, phantom: PhantomData,