diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-20 18:46:10 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-20 18:46:20 +0100 |
commit | 3170127a4ef79c43018775934c7e0444dc828b2d (patch) | |
tree | 02d32485116a708ad4cfd68a450d9bdfdf330340 /tests/tests.rs | |
parent | 91ca29ade1ab6b90dda972c2a42a5dc529ddfb44 (diff) |
make dyn trait take over super traits except Sized
Diffstat (limited to 'tests/tests.rs')
-rw-r--r-- | tests/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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<Box<dyn std::error::Error>> { t.foobar("test").err() } + +#[dynamize::dynamize] +trait TypeWithSuper: std::fmt::Display + Sized { + type A: std::error::Error; + + fn foobar(&self, text: &str) -> Result<i32, Self::A>; +} + +fn test3<T: TypeWithSuper>(some: T) { + let dyn_trait: &dyn DynTypeWithSuper = &some; + println!("{}", dyn_trait); +} |