From 3170127a4ef79c43018775934c7e0444dc828b2d Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 20 Nov 2021 18:46:10 +0100 Subject: make dyn trait take over super traits except Sized --- tests/tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/tests.rs b/tests/tests.rs index 3a14811..448af64 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -187,3 +187,15 @@ fn type_trait_bound_static_test( ) -> Option> { t.foobar("test").err() } + +#[dynamize::dynamize] +trait TypeWithSuper: std::fmt::Display + Sized { + type A: std::error::Error; + + fn foobar(&self, text: &str) -> Result; +} + +fn test3(some: T) { + let dyn_trait: &dyn DynTypeWithSuper = &some; + println!("{}", dyn_trait); +} -- cgit v1.2.3