From 68bd732e214c134c3b525da03d1409095f3b9b61 Mon Sep 17 00:00:00 2001 From: wandalen Date: Fri, 29 Mar 2024 23:54:03 +0200 Subject: [PATCH] former : experimenting --- .../tests/inc/former_tests/a_primitives_manual.rs | 11 +++++++++-- .../tests/inc/former_tests/only_test/primitives.rs | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/module/core/former/tests/inc/former_tests/a_primitives_manual.rs b/module/core/former/tests/inc/former_tests/a_primitives_manual.rs index b26549a0c3..430dbd8b4e 100644 --- a/module/core/former/tests/inc/former_tests/a_primitives_manual.rs +++ b/module/core/former/tests/inc/former_tests/a_primitives_manual.rs @@ -30,7 +30,9 @@ impl Struct1 pub struct Struct1FormerDefinition< Context = (), Formed = Struct1, End = former::ReturnPreformed > // xxx : use? // where -// End : FormingEnd< Struct1FormerDefinition< Context, Formed, NoEnd > >, +// End : former::FormingEnd< Struct1FormerDefinition< Context, Formed, NoEnd > >, +// where + // End : former::FormingEnd< Self >, { _phantom : core::marker::PhantomData< ( Context, Formed, End ) >, } @@ -53,6 +55,10 @@ for Struct1FormerDefinition< Context, Formed, End > impl< Context, Formed > former::FormerDefinitionTypes for Struct1FormerDefinition< Context, Formed, former::NoEnd > +// impl< Context, Formed, End > former::FormerDefinitionTypes +// for Struct1FormerDefinition< Context, Formed, End > +// where +// End : former::FormingEnd< Self >, { type Storage = Struct1FormerStorage; type Formed = Formed; @@ -63,9 +69,10 @@ impl< Context, Formed, End > former::FormerDefinition for Struct1FormerDefinition< Context, Formed, End > where End : former::FormingEnd< Struct1FormerDefinition< Context, Formed, former::NoEnd > >, + // End : former::FormingEnd< Self >, { - // type Types = Struct1FormerDefinition; type Types = Struct1FormerDefinition< Context, Formed, former::NoEnd >; + // type Types = Self; type End = End; } diff --git a/module/core/former/tests/inc/former_tests/only_test/primitives.rs b/module/core/former/tests/inc/former_tests/only_test/primitives.rs index 37c27d85f7..3ea0a9aafc 100644 --- a/module/core/former/tests/inc/former_tests/only_test/primitives.rs +++ b/module/core/former/tests/inc/former_tests/only_test/primitives.rs @@ -85,11 +85,9 @@ tests_impls! let _default = Struct1FormerDefinition::< () >::default(); // let _default = Struct1FormerDefinition::default(); // why does not work? - // impl< Context, Formed, End > Default - // definition types exists and has Formed let got = < Struct1FormerDefinition< (), Struct1, former::NoEnd > as the_module::FormerDefinitionTypes >::Formed::former().form(); - // let got = < Struct1FormerDefinition as the_module::FormerDefinitionTypes >::Formed::former().form(); // xxx : make it working + // let got = < Struct1FormerDefinition<> as the_module::FormerDefinitionTypes >::Formed::former().form(); let exp = Struct1::former().form(); a_id!( got, exp ); // xxx : uncomment