Diffstat (limited to 'tests/builder_struct.rs')
-rw-r--r--tests/builder_struct.rs24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/builder_struct.rs b/tests/builder_struct.rs
index b3502dd..290676b 100644
--- a/tests/builder_struct.rs
+++ b/tests/builder_struct.rs
@@ -117,7 +117,6 @@ impl<'ctx, M, E: Effect> builders::core::r#struct::StructTypeInfo<'ctx, M, E> fo
b: builders.b.build().into_future().await.unwrap(),
})
})
- .into_erased()
}
#[inline(always)]
@@ -141,7 +140,6 @@ impl<'ctx, M, E: Effect> builders::core::r#struct::StructTypeInfo<'ctx, M, E> fo
b: Builder::<E>::from_seed(()).into_future().await,
}
})
- .into_erased()
}
}
@@ -308,23 +306,33 @@ pub mod demo {
pub struct X {
pub a: bool,
pub b: bool,
+ pub c: bool,
}
- #[derive(Build!, Debug)]
+ #[derive(Build!, Debug, PartialEq)]
pub struct Y {
pub b: bool,
pub a: bool,
+ pub c: bool,
}
#[no_mangle]
+ #[inline(never)]
pub fn ident(x: X) -> Y {
- let other = transform::<<Y as crate::Build<'_, DefaultMode, _>>::Builder, _, Blocking<Spin>>(
- ((), ()),
- Walk::<DefaultMode, _>::into_walker(&x),
- );
+ let other =
+ transform::<<Y as crate::Build<'_, DefaultMode, _>>::Builder, _, Blocking<Spin>>(
+ ((), (), ()),
+ Walk::<DefaultMode, _>::into_walker(&x),
+ )
+ .value();
- let other = Spin::block_on(other.into_future());
+ // let other = Spin::block_on(other.into_future());
other.0.unwrap()
}
+
+ #[test]
+ fn demo() {
+ assert_eq!(ident(X { a: true, b: false, c: true }), Y { a: true, b: false, c: true });
+ }
}