mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-21 22:32:23 +00:00
Fix tests.
This commit is contained in:
parent
45f8752984
commit
e954e03307
@ -160,7 +160,7 @@ struct AnyBitPatternTest {
|
||||
struct NewtypeWrapperTest<T>(T);
|
||||
|
||||
#[derive(
|
||||
Debug, Copy, Clone, PartialEq, Eq, TransparentWrapper,
|
||||
Debug, Clone, PartialEq, Eq, TransparentWrapper,
|
||||
)]
|
||||
#[repr(transparent)]
|
||||
struct AlgebraicNewtypeWrapperTest<T>(Vec<T>);
|
||||
@ -173,7 +173,7 @@ fn algebraic_newtype_corect() {
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Debug, Copy, Clone, PartialEq, Eq, TransparentWrapper,
|
||||
Debug, Clone, PartialEq, Eq, TransparentWrapper,
|
||||
)]
|
||||
#[repr(transparent)]
|
||||
#[transparent(Vec<T>)]
|
||||
@ -182,7 +182,7 @@ struct AlgebraicNewtypeWrapperTestWithFields<T, U>(Vec<T>, PhantomData<U>);
|
||||
#[test]
|
||||
fn algebraic_newtype_fields_corect() {
|
||||
let x: Vec<u32> = vec![1, 2, 3, 4];
|
||||
let y: AlgebraicNewtypeWrapperTest<u32, f32> = AlgebraicNewtypeWrapperTest::wrap(x.clone());
|
||||
let y: AlgebraicNewtypeWrapperTestWithFields<u32, f32> = AlgebraicNewtypeWrapperTestWithFields::wrap(x.clone());
|
||||
assert_eq!(y.0, x);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user