use cc_traits::Collection; use lattices::map_union::MapUnionHashMap; use lattices::set_union::SetUnion; use lattices::{DomPair, IsBot, IsTop, Lattice, LatticeFrom, LatticeOrd, Max, Merge}; type Table = MapUnionHashMap>; type RowKey = String; type RowValEntry = DomPair; type RowVal = Max; /// Macro to test all the different derives on the same set of structs. macro_rules! test_derive_all { ( $( $m:ident => $i:ident, )* ) => { $( #[allow(clippy::allow_attributes, dead_code, reason = "compilation test code")] mod $m { use super::*; #[derive($i)] struct Pair { pub a: LatA, pub b: LatB, } #[derive($i)] struct MyTables { system: Table, user: Table, } #[derive($i)] struct Empty; #[derive($i)] struct Tuple(Max); #[derive($i)] struct TupleGeneric(Max, Max) where O: Ord; #[derive($i)] struct MyLattice where KeySet: Collection, Epoch: Ord, { keys: SetUnion, epoch: Max, } #[derive($i)] pub struct SimilarFields { a: Max, b: Max, c: Max, } } )* }; } test_derive_all! { // module_name => DeriveName, lattice => Lattice, merge => Merge, lattice_ord => LatticeOrd, is_top => IsTop, is_bot => IsBot, lattice_from => LatticeFrom, }