diff --git a/tests/weird.rs b/tests/weird.rs new file mode 100644 index 0000000..2b8d976 --- /dev/null +++ b/tests/weird.rs @@ -0,0 +1,36 @@ +use core::fmt::{Debug}; + +use serde_::{Serialize, Deserialize}; + +pub trait Protocol { + type ProtocolError: ProtocolError; +} + +pub trait ProtocolError: Debug + Clone + Serialize + for<'de> Deserialize<'de> {} + +pub trait ChainedProtocol: 'static + Debug { + type Protocol1: Protocol; +} + +#[derive_where::derive_where(Debug, Clone)] +#[derive(Serialize, Deserialize)] +#[serde(crate = "serde_")] +#[serde(bound(serialize = " + >::ProtocolError: Serialize, +"))] +#[serde(bound(deserialize = " + >::ProtocolError: for<'x> Deserialize<'x>, +"))] +pub enum ChainedProtocolError +where + C: ChainedProtocol, +{ + Protocol1(>::ProtocolError), +} + +impl ProtocolError for ChainedProtocolError +where + C: ChainedProtocol, +{ + +}