//! This test checks that the bounds added by the proc macro does not prevent the code to //! compile by leaking a private type use tfhe_versionable::Versionize; mod mymod { use tfhe_versionable::{Versionize, VersionsDispatch}; #[derive(Versionize)] #[versionize(PublicVersions)] pub struct Public { private: Private, } impl Public { pub fn new(val: u64) -> Self { Self { private: Private(val), } } } #[derive(VersionsDispatch)] #[allow(unused)] pub enum PublicVersions { V0(Public), } #[derive(Versionize)] #[versionize(PrivateVersions)] struct Private(T); #[derive(VersionsDispatch)] #[allow(dead_code)] enum PrivateVersions { V0(Private), } } #[test] fn bounds_private_in_public() { let public = mymod::Public::new(42); let _vers = public.versionize(); }