Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions zerocopy/src/byte_slice.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/byteorder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2019 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/deprecated.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/doctests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2025 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
4 changes: 3 additions & 1 deletion zerocopy/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down Expand Up @@ -1357,7 +1359,7 @@ mod simd {
#[cfg(not(no_zerocopy_aarch64_simd_1_59_0))]
simd_arch_mod!(
#[cfg(all(
target_arch = "aarch64",
target_arch = "aarch64",
any(
target_endian = "little",
not(no_zerocopy_aarch64_simd_be_1_87_0)
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/layout.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
4 changes: 3 additions & 1 deletion zerocopy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2018 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down Expand Up @@ -2833,7 +2835,7 @@ pub unsafe trait TryFromBytes {
/// ```
///
/// [`try_mut_from_bytes`]: TryFromBytes::try_mut_from_bytes
///
///
#[doc = codegen_header!("h5", "try_mut_from_bytes_with_elems")]
///
/// See [`TryFromBytes::try_ref_from_bytes_with_elems`](#method.try_ref_from_bytes_with_elems.codegen).
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/pointer/inner.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/pointer/invariant.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/pointer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2023 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/pointer/ptr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2023 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/pointer/transmute.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2025 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/ref.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2024 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/split_at.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2025 The Fuchsia Authors
//
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/util/macro_util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2022 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/util/macros.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2023 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2023 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
2 changes: 2 additions & 0 deletions zerocopy/src/wrappers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR MIT
//
// Copyright 2023 The Fuchsia Authors
//
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
Expand Down
8 changes: 4 additions & 4 deletions zerocopy/tests/ui/transmute-ptr-to-usize.nightly.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied
|
= note: Consider adding `#[derive(IntoBytes)]` to `*const usize`
help: the trait `IntoBytes` is implemented for `usize`
--> src/util/macros.rs:29:9
--> src/util/macros.rs:31:9
|
29 | unsafe impl $trait for $ty {
31 | unsafe impl $trait for $ty {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: src/impls.rs:77:5
::: src/impls.rs:79:5
|
77 | unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes);
79 | unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes);
| ----------------------------------------------------------------------------- in this macro invocation
note: required by a bound in `POINTER_VALUE::transmute`
--> $DIR/transmute-ptr-to-usize.rs:21:30
Expand Down
4 changes: 2 additions & 2 deletions zerocopy/tests/ui/transmute-ptr-to-usize.stable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied
|
= note: Consider adding `#[derive(IntoBytes)]` to `*const usize`
help: the trait `IntoBytes` is implemented for `usize`
--> $WORKSPACE/src/impls.rs:77:5
--> $WORKSPACE/src/impls.rs:79:5
|
77 | unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes);
79 | unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `POINTER_VALUE::transmute`
--> $DIR/transmute-ptr-to-usize.rs:21:30
Expand Down
4 changes: 2 additions & 2 deletions zerocopy/tests/ui/transmute_mut.msrv.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&mut [u8], &mut [u8; 1]>` due to unsatisfied trait bounds
|
::: $WORKSPACE/src/util/macro_util.rs:692:1
::: $WORKSPACE/src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| --------------------------------------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst`
|
= note: the following trait bounds were not satisfied:
Expand Down
32 changes: 16 additions & 16 deletions zerocopy/tests/ui/transmute_mut.nightly.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ help: the trait `FromBytes` is not implemented for `DstA`
(A, B, C, D, E, F, G, H)
and 85 others
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> src/util/macro_util.rs:812:14
--> src/util/macro_util.rs:814:14
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
...
812 | Dst: FromBytes + IntoBytes,
814 | Dst: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -73,12 +73,12 @@ help: the trait `IntoBytes` is not implemented for `DstB`
AtomicIsize
and 74 others
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> src/util/macro_util.rs:812:26
--> src/util/macro_util.rs:814:26
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
...
812 | Dst: FromBytes + IntoBytes,
814 | Dst: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down Expand Up @@ -149,12 +149,12 @@ help: the trait `FromBytes` is not implemented for `SrcC`
(A, B, C, D, E, F, G, H)
and 85 others
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> src/util/macro_util.rs:811:14
--> src/util/macro_util.rs:813:14
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
810 | where
811 | Src: FromBytes + IntoBytes,
812 | where
813 | Src: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -181,12 +181,12 @@ help: the trait `IntoBytes` is not implemented for `SrcD`
AtomicIsize
and 74 others
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> src/util/macro_util.rs:811:26
--> src/util/macro_util.rs:813:26
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
810 | where
811 | Src: FromBytes + IntoBytes,
812 | where
813 | Src: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -196,9 +196,9 @@ error[E0599]: the method `transmute_mut` exists for struct `zerocopy::util::macr
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: src/util/macro_util.rs:692:1
::: src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| ------------------------- doesn't satisfy `_: TransmuteMutDst<'_>`
|
= note: the following trait bounds were not satisfied:
Expand Down
32 changes: 16 additions & 16 deletions zerocopy/tests/ui/transmute_mut.stable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ help: the trait `FromBytes` is not implemented for `DstA`
(A, B, C, D, E, F, G, H)
and 85 others
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> $WORKSPACE/src/util/macro_util.rs:812:14
--> $WORKSPACE/src/util/macro_util.rs:814:14
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
...
812 | Dst: FromBytes + IntoBytes,
814 | Dst: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -73,12 +73,12 @@ help: the trait `IntoBytes` is not implemented for `DstB`
AtomicIsize
and 74 others
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> $WORKSPACE/src/util/macro_util.rs:812:26
--> $WORKSPACE/src/util/macro_util.rs:814:26
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
...
812 | Dst: FromBytes + IntoBytes,
814 | Dst: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down Expand Up @@ -149,12 +149,12 @@ help: the trait `FromBytes` is not implemented for `SrcC`
(A, B, C, D, E, F, G, H)
and 85 others
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> $WORKSPACE/src/util/macro_util.rs:811:14
--> $WORKSPACE/src/util/macro_util.rs:813:14
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
810 | where
811 | Src: FromBytes + IntoBytes,
812 | where
813 | Src: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -181,12 +181,12 @@ help: the trait `IntoBytes` is not implemented for `SrcD`
AtomicIsize
and 74 others
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
--> $WORKSPACE/src/util/macro_util.rs:811:26
--> $WORKSPACE/src/util/macro_util.rs:813:26
|
809 | pub fn transmute_mut(self) -> &'a mut Dst
811 | pub fn transmute_mut(self) -> &'a mut Dst
| ------------- required by a bound in this associated function
810 | where
811 | Src: FromBytes + IntoBytes,
812 | where
813 | Src: FromBytes + IntoBytes,
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -196,9 +196,9 @@ error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: $WORKSPACE/src/util/macro_util.rs:692:1
::: $WORKSPACE/src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| ------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst<'_>`
|
= note: the following trait bounds were not satisfied:
Expand Down
4 changes: 2 additions & 2 deletions zerocopy/tests/ui/transmute_ref.msrv.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ error[E0599]: the method `transmute_ref` exists for struct `Wrap<&[u8], &[u8; 1]
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&[u8], &[u8; 1]>` due to unsatisfied trait bounds
|
::: $WORKSPACE/src/util/macro_util.rs:692:1
::: $WORKSPACE/src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| --------------------------------------------------------- doesn't satisfy `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst`
|
= note: the following trait bounds were not satisfied:
Expand Down
4 changes: 2 additions & 2 deletions zerocopy/tests/ui/transmute_ref.nightly.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ error[E0599]: the method `transmute_ref` exists for struct `zerocopy::util::macr
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: src/util/macro_util.rs:692:1
::: src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| ------------------------- doesn't satisfy `_: TransmuteRefDst<'_>`
|
= note: the following trait bounds were not satisfied:
Expand Down
4 changes: 2 additions & 2 deletions zerocopy/tests/ui/transmute_ref.stable.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ error[E0599]: the method `transmute_ref` exists for struct `Wrap<&[u8], &[u8; 1]
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: $WORKSPACE/src/util/macro_util.rs:692:1
::: $WORKSPACE/src/util/macro_util.rs:694:1
|
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
694 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
| ------------------------- doesn't satisfy `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst<'_>`
|
= note: the following trait bounds were not satisfied:
Expand Down
Loading
Loading