Skip to content

Commit

Permalink
Impl ImplicitClone for arrays and ref arrays (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton authored Nov 9, 2023
1 parent 8ad7a09 commit 2606c0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ impl_implicit_clone!(
(),
);

impl<const N: usize, T: ImplicitClone> ImplicitClone for [T; N] {}

macro_rules! impl_implicit_clone_for_tuple {
($($param:ident),+ $(,)?) => {
impl<$($param: ImplicitClone),+> ImplicitClone for ($($param,)+) {}
Expand Down Expand Up @@ -160,9 +162,12 @@ mod test {

#[test]
fn copy_types() {
fn assert_copy<T: Copy>(_: T) {}

macro_rules! test_all {
($($t:ty),* $(,)?) => {
$(host_library!(<$t>::default());)*
$(assert_copy(<$t>::default());)*
};
}

Expand Down

0 comments on commit 2606c0f

Please sign in to comment.