Skip to content

Commit

Permalink
Implement Pod and Packed for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Mar 12, 2024
1 parent 036a68a commit a4b81b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions uapi/src/pod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ fn pod_write_common_prefix<T: Pod + ?Sized, U: Packed + ?Sized>(
unsafe impl<T: Pod> Pod for [T] {
}

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

// TODO: https://github.com/rust-lang/rust/pull/79135
// unsafe impl<T: Pod, const N: usize> Pod for [T; N] {
// }
Expand Down Expand Up @@ -215,6 +218,9 @@ pub unsafe trait Packed {}
unsafe impl<T: Packed> Packed for [T] {
}

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

// TODO: https://github.com/rust-lang/rust/pull/79135
// unsafe impl<T: Packed, const N: usize> Packed for [T; N] {
// }
Expand Down

0 comments on commit a4b81b1

Please sign in to comment.