diff --git a/tests/derive_arc/successes/assoc_function_rettype.rs b/tests/derive_arc/successes/assoc_function_rettype.rs new file mode 100644 index 0000000..ccf14d7 --- /dev/null +++ b/tests/derive_arc/successes/assoc_function_rettype.rs @@ -0,0 +1,21 @@ +use blanket::blanket; +use impls::impls; + +use std::sync::Arc; + +#[blanket(derive(Arc))] +pub trait StaticChecker { + fn check() -> Result<(), String>; +} + +#[derive(Default)] +struct NoOpChecker; + +impl StaticChecker for NoOpChecker { + fn check() -> Result<(), String> { Ok(()) } +} + +fn main() { + assert!(impls!( NoOpChecker: StaticChecker)); + assert!(impls!(Arc: StaticChecker)); +} diff --git a/tests/derive_box/successes/assoc_function_rettype.rs b/tests/derive_box/successes/assoc_function_rettype.rs new file mode 100644 index 0000000..b06e0a5 --- /dev/null +++ b/tests/derive_box/successes/assoc_function_rettype.rs @@ -0,0 +1,19 @@ +use blanket::blanket; +use impls::impls; + +#[blanket(derive(Box))] +pub trait StaticChecker { + fn check() -> Result<(), String>; +} + +#[derive(Default)] +struct NoOpChecker; + +impl StaticChecker for NoOpChecker { + fn check() -> Result<(), String> { Ok(()) } +} + +fn main() { + assert!(impls!( NoOpChecker: StaticChecker)); + assert!(impls!(Box: StaticChecker)); +} diff --git a/tests/derive_mut/successes/assoc_function_rettype.rs b/tests/derive_mut/successes/assoc_function_rettype.rs new file mode 100644 index 0000000..1bb8fa3 --- /dev/null +++ b/tests/derive_mut/successes/assoc_function_rettype.rs @@ -0,0 +1,19 @@ +use blanket::blanket; +use impls::impls; + +#[blanket(derive(Mut))] +pub trait StaticChecker { + fn check() -> Result<(), String>; +} + +#[derive(Default)] +struct NoOpChecker; + +impl StaticChecker for NoOpChecker { + fn check() -> Result<(), String> { Ok(()) } +} + +fn main() { + assert!(impls!( NoOpChecker: StaticChecker)); + assert!(impls!(&mut NoOpChecker: StaticChecker)); +} diff --git a/tests/derive_rc/successes/assoc_function_rettype.rs b/tests/derive_rc/successes/assoc_function_rettype.rs new file mode 100644 index 0000000..5625247 --- /dev/null +++ b/tests/derive_rc/successes/assoc_function_rettype.rs @@ -0,0 +1,21 @@ +use blanket::blanket; +use impls::impls; + +use std::rc::Rc; + +#[blanket(derive(Rc))] +pub trait StaticChecker { + fn check() -> Result<(), String>; +} + +#[derive(Default)] +struct NoOpChecker; + +impl StaticChecker for NoOpChecker { + fn check() -> Result<(), String> { Ok(()) } +} + +fn main() { + assert!(impls!( NoOpChecker: StaticChecker)); + assert!(impls!(Rc: StaticChecker)); +} diff --git a/tests/derive_ref/successes/assoc_function_rettype.rs b/tests/derive_ref/successes/assoc_function_rettype.rs new file mode 100644 index 0000000..fd5dca5 --- /dev/null +++ b/tests/derive_ref/successes/assoc_function_rettype.rs @@ -0,0 +1,19 @@ +use blanket::blanket; +use impls::impls; + +#[blanket(derive(Ref))] +pub trait StaticChecker { + fn check() -> Result<(), String>; +} + +#[derive(Default)] +struct NoOpChecker; + +impl StaticChecker for NoOpChecker { + fn check() -> Result<(), String> { Ok(()) } +} + +fn main() { + assert!(impls!( NoOpChecker: StaticChecker)); + assert!(impls!(&NoOpChecker: StaticChecker)); +}