diff --git a/tests/include.rs b/tests/include.rs new file mode 100644 index 0000000000..95bcbf4878 --- /dev/null +++ b/tests/include.rs @@ -0,0 +1,67 @@ +// Copyright 2026 The Fuchsia Authors +// +// Licensed under a BSD-style license , Apache License, Version 2.0 +// , or the MIT +// license , at your option. +// This file may not be copied, modified, or distributed except according to +// those terms. + +extern crate zerocopy; + +#[allow(unused)] +#[cfg(feature = "derive")] +mod util { + /// A type that doesn't implement any zerocopy traits. + pub struct NotZerocopy(pub T); + + /// A `u16` with alignment 2. + /// + /// Though `u16` has alignment 2 on some platforms, it's not guaranteed. By + /// contrast, `util::AU16` is guaranteed to have alignment 2. + #[derive( + zerocopy::KnownLayout, + zerocopy::Immutable, + zerocopy::FromBytes, + zerocopy::IntoBytes, + Copy, + Clone, + )] + #[repr(C, align(2))] + pub struct AU16(pub u16); + + // Since we can't import these by path (ie, `util::assert_impl_all!`), use a + // name prefix to ensure our derive-emitted code isn't accidentally relying + // on `assert_impl_all!` being in scope. + #[macro_export] + macro_rules! util_assert_impl_all { + ($type:ty: $($trait:path),+ $(,)?) => { + const _: fn() = || { + use ::core::prelude::v1::*; + ::static_assertions::assert_impl_all!($type: $($trait),+); + }; + }; + } + + // Since we can't import these by path (ie, `util::assert_not_impl_any!`), + // use a name prefix to ensure our derive-emitted code isn't accidentally + // relying on `assert_not_impl_any!` being in scope. + #[macro_export] + macro_rules! util_assert_not_impl_any { + ($x:ty: $($t:path),+ $(,)?) => { + const _: fn() = || { + use ::core::prelude::v1::*; + ::static_assertions::assert_not_impl_any!($x: $($t),+); + }; + }; + } + + #[macro_export] + macro_rules! test_trivial_is_bit_valid { + ($x:ty => $name:ident) => { + #[test] + fn $name() { + util::test_trivial_is_bit_valid::<$x>(); + } + }; + } +} diff --git a/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr b/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr index 8c7294f7fd..1b3a87e72a 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:16:24 | -18 | takes_from_bytes::(); - | ^^^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +16 | takes_from_bytes::(); + | ^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `takes_from_bytes` - --> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:21:24 + --> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:19:24 | -21 | fn takes_from_bytes() {} +19 | fn takes_from_bytes() {} | ^^^^^^^^^ required by this bound in `takes_from_bytes` diff --git a/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr b/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr index 894701e17e..e16480b9af 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:18:24 + --> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:16:24 | -18 | takes_from_zeros::(); +16 | takes_from_zeros::(); | ^^^^^^^^^^^ the trait `FromZeros` is not implemented for `NotZerocopy` | note: required by a bound in `takes_from_zeros` - --> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:21:24 + --> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:19:24 | -21 | fn takes_from_zeros() {} +19 | fn takes_from_zeros() {} | ^^^^^^^^^ required by this bound in `takes_from_zeros` diff --git a/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr b/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr index d0093ad8a1..37a4bdc911 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:18:23 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:16:23 | -18 | takes_immutable::(); - | ^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` +16 | takes_immutable::(); + | ^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy` | note: required by a bound in `takes_immutable` - --> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:21:23 + --> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:19:23 | -21 | fn takes_immutable() {} +19 | fn takes_immutable() {} | ^^^^^^^^^ required by this bound in `takes_immutable` diff --git a/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr b/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr index c2959ef8b8..5ba5bae60f 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:16:24 | -18 | takes_into_bytes::(); - | ^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +16 | takes_into_bytes::(); + | ^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` | note: required by a bound in `takes_into_bytes` - --> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:21:24 + --> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:19:24 | -21 | fn takes_into_bytes() {} +19 | fn takes_into_bytes() {} | ^^^^^^^^^ required by this bound in `takes_into_bytes` diff --git a/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr b/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr index 0475a6499e..7a0a498f4e 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); - | ^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` +50 | Foo.write_obj(NotZerocopy(())); + | ^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy` -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); - | ^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +50 | Foo.write_obj(NotZerocopy(())); + | ^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` diff --git a/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr b/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr index d3cfd29c6c..fe08341de5 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::KnownLayout` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:18:26 +error[E0277]: the trait bound `NotZerocopy: KnownLayout` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:16:26 | -18 | takes_known_layout::(); - | ^^^^^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `NotZerocopy` +16 | takes_known_layout::(); + | ^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `NotZerocopy` | note: required by a bound in `takes_known_layout` - --> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:21:26 + --> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:19:26 | -21 | fn takes_known_layout() {} +19 | fn takes_known_layout() {} | ^^^^^^^^^^^ required by this bound in `takes_known_layout` diff --git a/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr b/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr index 8e27c9c8cb..819d80683a 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr @@ -1,11 +1,11 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:18:28 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:16:28 | -18 | takes_try_from_bytes::(); - | ^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +16 | takes_try_from_bytes::(); + | ^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `takes_try_from_bytes` - --> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:21:28 + --> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:19:28 | -21 | fn takes_try_from_bytes() {} +19 | fn takes_try_from_bytes() {} | ^^^^^^^^^^^^ required by this bound in `takes_try_from_bytes` diff --git a/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr b/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr index 73ad6d9b17..2a6df94972 100644 --- a/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr +++ b/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:18:23 + --> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:16:23 | -18 | takes_unaligned::(); +16 | takes_unaligned::(); | ^^^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` | note: required by a bound in `takes_unaligned` - --> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:21:23 + --> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:19:23 | -21 | fn takes_unaligned() {} +19 | fn takes_unaligned() {} | ^^^^^^^^^ required by this bound in `takes_unaligned` diff --git a/tests/ui-msrv/include_value_not_from_bytes.stderr b/tests/ui-msrv/include_value_not_from_bytes.stderr index dea5dd1fe4..7b54ce1c30 100644 --- a/tests/ui-msrv/include_value_not_from_bytes.stderr +++ b/tests/ui-msrv/include_value_not_from_bytes.stderr @@ -1,15 +1,15 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/include_value_not_from_bytes.rs:19:42 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-msrv/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `NOT_FROM_BYTES::transmute` - --> tests/ui-msrv/include_value_not_from_bytes.rs:19:42 + --> tests/ui-msrv/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | required by a bound in this - | required by this bound in `NOT_FROM_BYTES::transmute` +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | required by a bound in this + | required by this bound in `NOT_FROM_BYTES::transmute` = note: this error originates in the macro `$crate::transmute` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/include_value_wrong_size.stderr b/tests/ui-msrv/include_value_wrong_size.stderr index b4531c7fa5..8ca7094213 100644 --- a/tests/ui-msrv/include_value_wrong_size.stderr +++ b/tests/ui-msrv/include_value_wrong_size.stderr @@ -1,8 +1,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/include_value_wrong_size.rs:15:25 + --> tests/ui-msrv/include_value_wrong_size.rs:12:25 | -15 | const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12 | const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `[u8; 4]` (32 bits) = note: target type: `u64` (64 bits) diff --git a/tests/ui-msrv/invalid-impls/invalid-impls.stderr b/tests/ui-msrv/invalid-impls/invalid-impls.stderr index 437864e90c..be9498f1cc 100644 --- a/tests/ui-msrv/invalid-impls/invalid-impls.stderr +++ b/tests/ui-msrv/invalid-impls/invalid-impls.stderr @@ -4,15 +4,15 @@ error[E0277]: the trait bound `T: zerocopy::TryFromBytes` is not satisfied | impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),*> Subtrait for $ty {} | ^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `T` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:27:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:26:5 | -27 | impl_or_verify!(T => TryFromBytes for Foo); +26 | impl_or_verify!(T => TryFromBytes for Foo); | ---------------------------------------------- in this macro invocation | note: required because of the requirements on the impl of `zerocopy::TryFromBytes` for `Foo` - --> tests/ui-msrv/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-msrv/invalid-impls/invalid-impls.rs:21:10 | -22 | #[derive(FromBytes, IntoBytes, Unaligned)] +21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::Subtrait` --> tests/ui-msrv/invalid-impls/../../../src/util/macros.rs @@ -20,14 +20,14 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `_::Subtrait` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:27:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:26:5 | -27 | impl_or_verify!(T => TryFromBytes for Foo); +26 | impl_or_verify!(T => TryFromBytes for Foo); | ---------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -27 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); +26 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); | ++++++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromZeros` is not satisfied @@ -36,15 +36,15 @@ error[E0277]: the trait bound `T: zerocopy::FromZeros` is not satisfied | impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),*> Subtrait for $ty {} | ^^^^^^^^ the trait `zerocopy::FromZeros` is not implemented for `T` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:28:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:27:5 | -28 | impl_or_verify!(T => FromZeros for Foo); +27 | impl_or_verify!(T => FromZeros for Foo); | ------------------------------------------- in this macro invocation | note: required because of the requirements on the impl of `zerocopy::FromZeros` for `Foo` - --> tests/ui-msrv/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-msrv/invalid-impls/invalid-impls.rs:21:10 | -22 | #[derive(FromBytes, IntoBytes, Unaligned)] +21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::Subtrait` --> tests/ui-msrv/invalid-impls/../../../src/util/macros.rs @@ -52,14 +52,14 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `_::Subtrait` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:28:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:27:5 | -28 | impl_or_verify!(T => FromZeros for Foo); +27 | impl_or_verify!(T => FromZeros for Foo); | ------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -28 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); +27 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied @@ -68,15 +68,15 @@ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied | impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),*> Subtrait for $ty {} | ^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:29:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:28:5 | -29 | impl_or_verify!(T => FromBytes for Foo); +28 | impl_or_verify!(T => FromBytes for Foo); | ------------------------------------------- in this macro invocation | note: required because of the requirements on the impl of `zerocopy::FromBytes` for `Foo` - --> tests/ui-msrv/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-msrv/invalid-impls/invalid-impls.rs:21:10 | -22 | #[derive(FromBytes, IntoBytes, Unaligned)] +21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::Subtrait` --> tests/ui-msrv/invalid-impls/../../../src/util/macros.rs @@ -84,14 +84,14 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `_::Subtrait` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:29:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:28:5 | -29 | impl_or_verify!(T => FromBytes for Foo); +28 | impl_or_verify!(T => FromBytes for Foo); | ------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -29 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); +28 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::IntoBytes` is not satisfied @@ -100,15 +100,15 @@ error[E0277]: the trait bound `T: zerocopy::IntoBytes` is not satisfied | impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),*> Subtrait for $ty {} | ^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `T` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:30:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:29:5 | -30 | impl_or_verify!(T => IntoBytes for Foo); +29 | impl_or_verify!(T => IntoBytes for Foo); | ------------------------------------------- in this macro invocation | note: required because of the requirements on the impl of `zerocopy::IntoBytes` for `Foo` - --> tests/ui-msrv/invalid-impls/invalid-impls.rs:22:21 + --> tests/ui-msrv/invalid-impls/invalid-impls.rs:21:21 | -22 | #[derive(FromBytes, IntoBytes, Unaligned)] +21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::Subtrait` --> tests/ui-msrv/invalid-impls/../../../src/util/macros.rs @@ -116,14 +116,14 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `_::Subtrait` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:30:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:29:5 | -30 | impl_or_verify!(T => IntoBytes for Foo); +29 | impl_or_verify!(T => IntoBytes for Foo); | ------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -30 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); +29 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied @@ -132,15 +132,15 @@ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied | impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),*> Subtrait for $ty {} | ^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:31:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:30:5 | -31 | impl_or_verify!(T => Unaligned for Foo); +30 | impl_or_verify!(T => Unaligned for Foo); | ------------------------------------------- in this macro invocation | note: required because of the requirements on the impl of `zerocopy::Unaligned` for `Foo` - --> tests/ui-msrv/invalid-impls/invalid-impls.rs:22:32 + --> tests/ui-msrv/invalid-impls/invalid-impls.rs:21:32 | -22 | #[derive(FromBytes, IntoBytes, Unaligned)] +21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::Subtrait` --> tests/ui-msrv/invalid-impls/../../../src/util/macros.rs @@ -148,12 +148,12 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `_::Subtrait` | - ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:31:5 + ::: tests/ui-msrv/invalid-impls/invalid-impls.rs:30:5 | -31 | impl_or_verify!(T => Unaligned for Foo); +30 | impl_or_verify!(T => Unaligned for Foo); | ------------------------------------------- in this macro invocation = note: this error originates in the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -31 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); +30 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); | +++++++++++++++++++++ diff --git a/tests/ui-msrv/transmute-dst-not-frombytes.stderr b/tests/ui-msrv/transmute-dst-not-frombytes.stderr index e3f7f5d630..e337c1f9b7 100644 --- a/tests/ui-msrv/transmute-dst-not-frombytes.stderr +++ b/tests/ui-msrv/transmute-dst-not-frombytes.stderr @@ -1,13 +1,13 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/transmute-dst-not-frombytes.rs:19:41 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-msrv/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); - | ^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); + | ^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `DST_NOT_FROM_BYTES::transmute` - --> tests/ui-msrv/transmute-dst-not-frombytes.rs:19:41 + --> tests/ui-msrv/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this diff --git a/tests/ui-msrv/transmute-mut-const.stderr b/tests/ui-msrv/transmute-mut-const.stderr index 8578fa1932..2e1573f9ec 100644 --- a/tests/ui-msrv/transmute-mut-const.stderr +++ b/tests/ui-msrv/transmute-mut-const.stderr @@ -1,38 +1,38 @@ warning: taking a mutable reference to a `const` item - --> tests/ui-msrv/transmute-mut-const.rs:20:52 + --> tests/ui-msrv/transmute-mut-const.rs:18:52 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^ | = note: `#[warn(const_item_mutation)]` on by default = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here - --> tests/ui-msrv/transmute-mut-const.rs:17:1 + --> tests/ui-msrv/transmute-mut-const.rs:15:1 | -17 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; +15 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0658]: mutable references are not allowed in constants - --> tests/ui-msrv/transmute-mut-const.rs:20:52 + --> tests/ui-msrv/transmute-mut-const.rs:18:52 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^ | = note: see issue #57349 for more information error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants - --> tests/ui-msrv/transmute-mut-const.rs:20:37 + --> tests/ui-msrv/transmute-mut-const.rs:18:37 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0716]: temporary value dropped while borrowed - --> tests/ui-msrv/transmute-mut-const.rs:20:57 + --> tests/ui-msrv/transmute-mut-const.rs:18:57 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | --------------------^^^^^^^^^^^^- | | | | | creates a temporary which is freed while still in use diff --git a/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr b/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr index 295aa211ab..5ddba9af64 100644 --- a/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +++ b/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-mut-dst-not-a-reference.rs:17:36 + --> tests/ui-msrv/transmute-mut-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _` | = note: expected type `usize` diff --git a/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr b/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr index abb87e63fd..de71445873 100644 --- a/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr +++ b/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-msrv/transmute-mut-dst-not-frombytes.rs:24:38 + --> tests/ui-msrv/transmute-mut-dst-not-frombytes.rs:22:38 | -24 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); +22 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr b/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr index 2f4da83a59..0e8b9c14e5 100644 --- a/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr +++ b/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-mut-dst-not-intobytes.rs:24:36 + --> tests/ui-msrv/transmute-mut-dst-not-intobytes.rs:22:36 | -24 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); +22 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-mut-dst-unsized.stderr b/tests/ui-msrv/transmute-mut-dst-unsized.stderr index 087d7b816c..0992bfb6e5 100644 --- a/tests/ui-msrv/transmute-mut-dst-unsized.stderr +++ b/tests/ui-msrv/transmute-mut-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-msrv/transmute-mut-dst-unsized.rs:17:32 + --> tests/ui-msrv/transmute-mut-dst-unsized.rs:15:32 | -17 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); +15 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr b/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr index c500a93af7..0d6e56dc1e 100644 --- a/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr +++ b/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-mut-src-dst-not-references.rs:17:59 + --> tests/ui-msrv/transmute-mut-src-dst-not-references.rs:15:59 | -17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); +15 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` diff --git a/tests/ui-msrv/transmute-mut-src-immutable.stderr b/tests/ui-msrv/transmute-mut-src-immutable.stderr index 8262f169a2..bae697c838 100644 --- a/tests/ui-msrv/transmute-mut-src-immutable.stderr +++ b/tests/ui-msrv/transmute-mut-src-immutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-mut-src-immutable.rs:17:37 + --> tests/ui-msrv/transmute-mut-src-immutable.rs:15:37 | -17 | let _: &mut u8 = transmute_mut!(&0u8); +15 | let _: &mut u8 = transmute_mut!(&0u8); | ---------------^^^^- | | | | | types differ in mutability diff --git a/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr b/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr index 3a6bdf78a6..ca8669d037 100644 --- a/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr +++ b/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-mut-src-not-a-reference.rs:17:53 + --> tests/ui-msrv/transmute-mut-src-not-a-reference.rs:15:53 | -17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); +15 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` diff --git a/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr b/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr index 01dd91fa32..6fbc73eeb0 100644 --- a/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr +++ b/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-msrv/transmute-mut-src-not-frombytes.rs:24:38 + --> tests/ui-msrv/transmute-mut-src-not-frombytes.rs:22:38 | -24 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); +22 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Src` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr b/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr index 5b8735628b..4bc57109fc 100644 --- a/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr +++ b/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-mut-src-not-intobytes.rs:24:36 + --> tests/ui-msrv/transmute-mut-src-not-intobytes.rs:22:36 | -24 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); +22 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Src` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-mut-src-unsized.stderr b/tests/ui-msrv/transmute-mut-src-unsized.stderr index bacd62f336..d5357217a4 100644 --- a/tests/ui-msrv/transmute-mut-src-unsized.stderr +++ b/tests/ui-msrv/transmute-mut-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-msrv/transmute-mut-src-unsized.rs:17:35 + --> tests/ui-msrv/transmute-mut-src-unsized.rs:15:35 | -17 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); +15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize` | = note: required because of the requirements on the impl of `TransmuteMutDst<'_>` for `Wrap<&mut [u8], &mut [u8; 1]>` diff --git a/tests/ui-msrv/transmute-ptr-to-usize.stderr b/tests/ui-msrv/transmute-ptr-to-usize.stderr index c57f7cdce3..d00c98fe8f 100644 --- a/tests/ui-msrv/transmute-ptr-to-usize.stderr +++ b/tests/ui-msrv/transmute-ptr-to-usize.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-msrv/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `*const usize` | note: required by a bound in `POINTER_VALUE::transmute` - --> tests/ui-msrv/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-msrv/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this diff --git a/tests/ui-msrv/transmute-ref-dst-mutable.stderr b/tests/ui-msrv/transmute-ref-dst-mutable.stderr index 5ccf2cd20d..bf72958111 100644 --- a/tests/ui-msrv/transmute-ref-dst-mutable.stderr +++ b/tests/ui-msrv/transmute-ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-msrv/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-msrv/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-msrv/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` diff --git a/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr b/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr index 9a61c4c7ce..037ccd2092 100644 --- a/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +++ b/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` diff --git a/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr b/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr index 9cdc03ef84..05ae73925f 100644 --- a/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr +++ b/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr @@ -1,12 +1,12 @@ -error[E0277]: the trait bound `Dst: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/transmute-ref-dst-not-frombytes.rs:23:34 +error[E0277]: the trait bound `Dst: FromBytes` is not satisfied + --> tests/ui-msrv/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `Dst` +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Dst` | note: required by `AssertDstIsFromBytes` - --> tests/ui-msrv/transmute-ref-dst-not-frombytes.rs:23:34 + --> tests/ui-msrv/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr b/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr index 899805b05c..572b25a964 100644 --- a/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr +++ b/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr @@ -1,12 +1,12 @@ -error[E0277]: the trait bound `Dst: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/transmute-ref-dst-not-nocell.rs:23:33 +error[E0277]: the trait bound `Dst: Immutable` is not satisfied + --> tests/ui-msrv/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `Dst` +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `Dst` | note: required by `AssertDstIsImmutable` - --> tests/ui-msrv/transmute-ref-dst-not-nocell.rs:23:33 + --> tests/ui-msrv/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-ref-dst-unsized.stderr b/tests/ui-msrv/transmute-ref-dst-unsized.stderr index 11b38acb8b..2d1b180e91 100644 --- a/tests/ui-msrv/transmute-ref-dst-unsized.stderr +++ b/tests/ui-msrv/transmute-ref-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-msrv/transmute-ref-dst-unsized.rs:17:28 + --> tests/ui-msrv/transmute-ref-dst-unsized.rs:15:28 | -17 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); +15 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr b/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr index 2c5e23b6dd..61ab53bce8 100644 --- a/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +++ b/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:17:54 + --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:15:54 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected reference, found `usize` @@ -12,9 +12,9 @@ error[E0308]: mismatched types found type `usize` error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` @@ -22,9 +22,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` @@ -32,9 +32,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference | = note: expected type `usize` diff --git a/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr b/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr index 0f4aeec9e2..590ab51bf1 100644 --- a/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr +++ b/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/transmute-ref-src-not-a-reference.rs:17:49 + --> tests/ui-msrv/transmute-ref-src-not-a-reference.rs:15:49 | -17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); +15 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected reference, found `usize` diff --git a/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr b/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr index 84036b70ba..47795b23f1 100644 --- a/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr +++ b/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr @@ -1,25 +1,25 @@ -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `Src` +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Src` | note: required by `AssertSrcIsIntoBytes` - --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `Src` +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Src` | note: required by a bound in `AssertSrcIsIntoBytes` - --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-msrv/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsIntoBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-ref-src-not-nocell.stderr b/tests/ui-msrv/transmute-ref-src-not-nocell.stderr index 2e94e8064a..86ff3a8a73 100644 --- a/tests/ui-msrv/transmute-ref-src-not-nocell.stderr +++ b/tests/ui-msrv/transmute-ref-src-not-nocell.stderr @@ -1,25 +1,25 @@ -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `zerocopy::Immutable` +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Immutable` | note: required by `AssertSrcIsImmutable` - --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `Src` +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `Src` | note: required by a bound in `AssertSrcIsImmutable` - --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-msrv/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/transmute-ref-src-unsized.stderr b/tests/ui-msrv/transmute-ref-src-unsized.stderr index 736a653033..106a63ba1d 100644 --- a/tests/ui-msrv/transmute-ref-src-unsized.stderr +++ b/tests/ui-msrv/transmute-ref-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-msrv/transmute-ref-src-unsized.rs:16:31 + --> tests/ui-msrv/transmute-ref-src-unsized.rs:14:31 | -16 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); +14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize` | = note: required because of the requirements on the impl of `TransmuteRefDst<'_>` for `Wrap<&[u8], &[u8; 1]>` diff --git a/tests/ui-msrv/transmute-size-decrease.stderr b/tests/ui-msrv/transmute-size-decrease.stderr index 33f9cf2ee7..063797806d 100644 --- a/tests/ui-msrv/transmute-size-decrease.stderr +++ b/tests/ui-msrv/transmute-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/transmute-size-decrease.rs:20:27 + --> tests/ui-msrv/transmute-size-decrease.rs:18:27 | -20 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); +18 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr b/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr index 9d03a36302..016bb217c7 100644 --- a/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr +++ b/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/transmute-size-increase-allow-shrink.rs:20:29 + --> tests/ui-msrv/transmute-size-increase-allow-shrink.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-msrv/transmute-size-increase.stderr b/tests/ui-msrv/transmute-size-increase.stderr index 64aa798f9d..8f36c38206 100644 --- a/tests/ui-msrv/transmute-size-increase.stderr +++ b/tests/ui-msrv/transmute-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/transmute-size-increase.rs:20:29 + --> tests/ui-msrv/transmute-size-increase.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(0u8); | ^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-msrv/transmute-src-not-intobytes.stderr b/tests/ui-msrv/transmute-src-not-intobytes.stderr index 1a96a1364c..4f0ce77462 100644 --- a/tests/ui-msrv/transmute-src-not-intobytes.stderr +++ b/tests/ui-msrv/transmute-src-not-intobytes.stderr @@ -1,13 +1,13 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/transmute-src-not-intobytes.rs:19:32 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` | note: required by a bound in `SRC_NOT_AS_BYTES::transmute` - --> tests/ui-msrv/transmute-src-not-intobytes.rs:19:32 + --> tests/ui-msrv/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this diff --git a/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr b/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr index 5536f61216..1d8cb404bc 100644 --- a/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr +++ b/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:15:58 | -17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute` --> src/util/macro_util.rs @@ -11,11 +11,11 @@ note: required by a bound in `try_transmute` | ^^^^^^^^^^^^ required by this bound in `try_transmute` = note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:17:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:15:33 | -17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs @@ -23,11 +23,11 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs:15:58 | -17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs diff --git a/tests/ui-msrv/try_transmute-size-decrease.stderr b/tests/ui-msrv/try_transmute-size-decrease.stderr index 3dcc428606..b00fa63ae9 100644 --- a/tests/ui-msrv/try_transmute-size-decrease.stderr +++ b/tests/ui-msrv/try_transmute-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute-size-decrease.rs:19:41 + --> tests/ui-msrv/try_transmute-size-decrease.rs:17:41 | -19 | let _decrease_size: Result = try_transmute!(AU16(0)); +17 | let _decrease_size: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-msrv/try_transmute-size-increase.stderr b/tests/ui-msrv/try_transmute-size-increase.stderr index 5b875e0931..693902af4e 100644 --- a/tests/ui-msrv/try_transmute-size-increase.stderr +++ b/tests/ui-msrv/try_transmute-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute-size-increase.rs:19:43 + --> tests/ui-msrv/try_transmute-size-increase.rs:17:43 | -19 | let _increase_size: Result = try_transmute!(0u8); +17 | let _increase_size: Result = try_transmute!(0u8); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-msrv/try_transmute-src-not-intobytes.stderr b/tests/ui-msrv/try_transmute-src-not-intobytes.stderr index 589f8931d7..f9b65cbdc8 100644 --- a/tests/ui-msrv/try_transmute-src-not-intobytes.stderr +++ b/tests/ui-msrv/try_transmute-src-not-intobytes.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute-src-not-intobytes.rs:18:47 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/try_transmute-src-not-intobytes.rs:16:47 | -18 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +16 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute` --> src/util/macro_util.rs diff --git a/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr b/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr index 640936ccc2..02e4d66256 100644 --- a/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr +++ b/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_mut-alignment-increase.rs:20:48 + --> tests/ui-msrv/try_transmute_mut-alignment-increase.rs:18:48 | -20 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr b/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr index a3b496b470..a480369e1b 100644 --- a/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +++ b/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | -20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute_mut` --> src/util/macro_util.rs @@ -11,11 +11,11 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | -20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute_mut` --> src/util/macro_util.rs @@ -24,11 +24,11 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:20:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:18:33 | -20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs @@ -36,11 +36,11 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | -20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs diff --git a/tests/ui-msrv/try_transmute_mut-size-decrease.stderr b/tests/ui-msrv/try_transmute_mut-size-decrease.stderr index cd0e3b547b..0178c032bf 100644 --- a/tests/ui-msrv/try_transmute_mut-size-decrease.stderr +++ b/tests/ui-msrv/try_transmute_mut-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_mut-size-decrease.rs:20:46 + --> tests/ui-msrv/try_transmute_mut-size-decrease.rs:18:46 | -20 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); +18 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-msrv/try_transmute_mut-size-increase.stderr b/tests/ui-msrv/try_transmute_mut-size-increase.stderr index c1d7816739..950e2e1d0c 100644 --- a/tests/ui-msrv/try_transmute_mut-size-increase.stderr +++ b/tests/ui-msrv/try_transmute_mut-size-increase.stderr @@ -1,15 +1,15 @@ warning: unused import: `util::AU16` - --> tests/ui-msrv/try_transmute_mut-size-increase.rs:13:5 + --> tests/ui-msrv/try_transmute_mut-size-increase.rs:11:5 | -13 | use util::AU16; +11 | use util::AU16; | ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_mut-size-increase.rs:20:51 + --> tests/ui-msrv/try_transmute_mut-size-increase.rs:18:51 | -20 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr b/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr index f088592e82..05f13ad210 100644 --- a/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr +++ b/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr @@ -1,23 +1,23 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Src` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr b/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr index 76ace191ec..de6b9fe712 100644 --- a/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr +++ b/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr @@ -1,23 +1,23 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Src` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs:21:40 | -23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); +21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `Dst` | = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr b/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr index 631aec108b..17fdfd2164 100644 --- a/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr +++ b/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_ref-alignment-increase.rs:19:44 + --> tests/ui-msrv/try_transmute_ref-alignment-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr b/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr index 2c4ca40c00..09fa8a30a8 100644 --- a/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +++ b/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-msrv/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-msrv/try_transmute_ref-dst-mutable.rs:16:33 | -18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); +16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-msrv/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-msrv/try_transmute_ref-dst-mutable.rs:16:33 | -18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); +16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | types differ in mutability diff --git a/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr b/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr index fb6e75f23e..5a7303ce9e 100644 --- a/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +++ b/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | -19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute_ref` --> src/util/macro_util.rs @@ -11,11 +11,11 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | -19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` +17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute_ref` --> src/util/macro_util.rs @@ -24,11 +24,11 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:33 | -19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs @@ -36,11 +36,11 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | -19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` --> src/error.rs diff --git a/tests/ui-msrv/try_transmute_ref-size-decrease.stderr b/tests/ui-msrv/try_transmute_ref-size-decrease.stderr index bbee5e1369..b6e47dcc7f 100644 --- a/tests/ui-msrv/try_transmute_ref-size-decrease.stderr +++ b/tests/ui-msrv/try_transmute_ref-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_ref-size-decrease.rs:19:42 + --> tests/ui-msrv/try_transmute_ref-size-decrease.rs:17:42 | -19 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); +17 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-msrv/try_transmute_ref-size-increase.stderr b/tests/ui-msrv/try_transmute_ref-size-increase.stderr index 66362f089b..3d806e365b 100644 --- a/tests/ui-msrv/try_transmute_ref-size-increase.stderr +++ b/tests/ui-msrv/try_transmute_ref-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-msrv/try_transmute_ref-size-increase.rs:19:44 + --> tests/ui-msrv/try_transmute_ref-size-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr b/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr index ca5a0daf99..791c94f455 100644 --- a/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +++ b/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | -19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy` | note: required by a bound in `try_transmute_ref` --> src/util/macro_util.rs @@ -11,11 +11,11 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | -19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `zerocopy::Immutable` +17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Immutable` | note: required by a bound in `try_transmute_ref` --> src/util/macro_util.rs diff --git a/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs b/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs index 327abca3fb..e8c6d1d531 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::FromBytes; diff --git a/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr b/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr index 042473b972..4d8bbf8c79 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs:16:24 | -18 | takes_from_bytes::(); +16 | takes_from_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,7 +21,7 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_from_bytes` - --> tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs:21:24 + --> tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs:19:24 | -21 | fn takes_from_bytes() {} +19 | fn takes_from_bytes() {} | ^^^^^^^^^ required by this bound in `takes_from_bytes` diff --git a/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs b/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs index 6f7f41c24a..a84a833c13 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::FromZeros; diff --git a/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr b/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr index 77df3f445c..a7e8b97fc0 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs:18:24 + --> tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs:16:24 | -18 | takes_from_zeros::(); +16 | takes_from_zeros::(); | ^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ help: the trait `FromZeros` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_from_zeros` - --> tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs:21:24 + --> tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs:19:24 | -21 | fn takes_from_zeros() {} +19 | fn takes_from_zeros() {} | ^^^^^^^^^ required by this bound in `takes_from_zeros` diff --git a/tests/ui-nightly/diagnostic-not-implemented-immutable.rs b/tests/ui-nightly/diagnostic-not-implemented-immutable.rs index 0432ed446d..48e9e65801 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-immutable.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-immutable.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::Immutable; diff --git a/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr b/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr index f08ae8280d..df7294ba7c 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-immutable.rs:18:23 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-immutable.rs:16:23 | -18 | takes_immutable::(); +16 | takes_immutable::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -21,7 +21,7 @@ help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` (A, B, C, D, E, F) and $N others note: required by a bound in `takes_immutable` - --> tests/ui-nightly/diagnostic-not-implemented-immutable.rs:21:23 + --> tests/ui-nightly/diagnostic-not-implemented-immutable.rs:19:23 | -21 | fn takes_immutable() {} +19 | fn takes_immutable() {} | ^^^^^^^^^ required by this bound in `takes_immutable` diff --git a/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs b/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs index f94355362d..a348aafdf1 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::IntoBytes; diff --git a/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr b/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr index 07031fe3d4..dfb29ad454 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs:16:24 | -18 | takes_into_bytes::(); +16 | takes_into_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -21,7 +21,7 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `takes_into_bytes` - --> tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs:21:24 + --> tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs:19:24 | -21 | fn takes_into_bytes() {} +19 | fn takes_into_bytes() {} | ^^^^^^^^^ required by this bound in `takes_into_bytes` diff --git a/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs b/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs index e12737a6a3..5b048e7581 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::{Immutable, IntoBytes}; diff --git a/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr b/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr index a6c817b71f..24453f41b3 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr @@ -1,38 +1,38 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); - | --------- ^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` +50 | Foo.write_obj(NotZerocopy(())); + | --------- ^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy` | | | required by a bound introduced by this call | note: required by a bound in `Foo::write_obj` - --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:58:21 + --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:56:21 | -58 | fn write_obj(&mut self, _val: T) {} +56 | fn write_obj(&mut self, _val: T) {} | ^^^^^^^^^ required by this bound in `Foo::write_obj` help: consider borrowing here | -52 | Foo.write_obj(&NotZerocopy(())); +50 | Foo.write_obj(&NotZerocopy(())); | + -52 | Foo.write_obj(&mut NotZerocopy(())); +50 | Foo.write_obj(&mut NotZerocopy(())); | ++++ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); +50 | Foo.write_obj(NotZerocopy(())); | --------- ^^^^^^^^^^^^^^^ unsatisfied trait bound | | | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -43,7 +43,7 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `Foo::write_obj` - --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:58:33 + --> tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs:56:33 | -58 | fn write_obj(&mut self, _val: T) {} +56 | fn write_obj(&mut self, _val: T) {} | ^^^^^^^^^ required by this bound in `Foo::write_obj` diff --git a/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs b/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs index 2e306c25ba..ded20312be 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::KnownLayout; diff --git a/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr b/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr index 3047a38c94..7fed63a879 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::KnownLayout` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-known-layout.rs:18:26 +error[E0277]: the trait bound `NotZerocopy: KnownLayout` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-known-layout.rs:16:26 | -18 | takes_known_layout::(); +16 | takes_known_layout::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `KnownLayout` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `KnownLayout`: &T &mut T () @@ -21,7 +21,7 @@ help: the trait `zerocopy::KnownLayout` is not implemented for `NotZerocopy` AtomicI16 and $N others note: required by a bound in `takes_known_layout` - --> tests/ui-nightly/diagnostic-not-implemented-known-layout.rs:21:26 + --> tests/ui-nightly/diagnostic-not-implemented-known-layout.rs:19:26 | -21 | fn takes_known_layout() {} +19 | fn takes_known_layout() {} | ^^^^^^^^^^^ required by this bound in `takes_known_layout` diff --git a/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs b/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs index 72e72139f1..18900ecaa6 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::TryFromBytes; diff --git a/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr b/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr index 11d9fae39f..b5b3691400 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs:18:28 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs:16:28 | -18 | takes_try_from_bytes::(); +16 | takes_try_from_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -21,7 +21,7 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_try_from_bytes` - --> tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs:21:28 + --> tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs:19:28 | -21 | fn takes_try_from_bytes() {} +19 | fn takes_try_from_bytes() {} | ^^^^^^^^^^^^ required by this bound in `takes_try_from_bytes` diff --git a/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs b/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs index 95ce5bd589..6196f6a75b 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs +++ b/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; use zerocopy::Unaligned; diff --git a/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr b/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr index 6dc71104ac..cbb83d2816 100644 --- a/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr +++ b/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/diagnostic-not-implemented-unaligned.rs:18:23 + --> tests/ui-nightly/diagnostic-not-implemented-unaligned.rs:16:23 | -18 | takes_unaligned::(); +16 | takes_unaligned::(); | ^^^^^^^^^^^ unsatisfied trait bound | help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` I128 and $N others note: required by a bound in `takes_unaligned` - --> tests/ui-nightly/diagnostic-not-implemented-unaligned.rs:21:23 + --> tests/ui-nightly/diagnostic-not-implemented-unaligned.rs:19:23 | -21 | fn takes_unaligned() {} +19 | fn takes_unaligned() {} | ^^^^^^^^^ required by this bound in `takes_unaligned` diff --git a/tests/ui-nightly/include_value_not_from_bytes.rs b/tests/ui-nightly/include_value_not_from_bytes.rs index e628933612..e01c4a9b6a 100644 --- a/tests/ui-nightly/include_value_not_from_bytes.rs +++ b/tests/ui-nightly/include_value_not_from_bytes.rs @@ -6,14 +6,12 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -#[macro_use] -extern crate zerocopy; +include!("../include.rs"); use util::NotZerocopy; fn main() {} // Should fail because `NotZerocopy: !FromBytes`. -const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); +const NOT_FROM_BYTES: NotZerocopy = + zerocopy::include_value!("../../testdata/include_value/data"); diff --git a/tests/ui-nightly/include_value_not_from_bytes.stderr b/tests/ui-nightly/include_value_not_from_bytes.stderr index e95e72b762..1d20b88346 100644 --- a/tests/ui-nightly/include_value_not_from_bytes.stderr +++ b/tests/ui-nightly/include_value_not_from_bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/include_value_not_from_bytes.rs:19:42 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-nightly/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,11 +21,11 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `NOT_FROM_BYTES::transmute` - --> tests/ui-nightly/include_value_not_from_bytes.rs:19:42 + --> tests/ui-nightly/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | required by a bound in this function - | required by this bound in `transmute` - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | required by a bound in this function + | required by this bound in `transmute` + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/include_value_wrong_size.rs b/tests/ui-nightly/include_value_wrong_size.rs index e02b2be838..d0c5fcfc5f 100644 --- a/tests/ui-nightly/include_value_wrong_size.rs +++ b/tests/ui-nightly/include_value_wrong_size.rs @@ -6,10 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -#[macro_use] -extern crate zerocopy; - fn main() {} // Should fail because the file is 4 bytes long, not 8. -const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); +const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); diff --git a/tests/ui-nightly/include_value_wrong_size.stderr b/tests/ui-nightly/include_value_wrong_size.stderr index 4f9472ea81..3a6f98da51 100644 --- a/tests/ui-nightly/include_value_wrong_size.stderr +++ b/tests/ui-nightly/include_value_wrong_size.stderr @@ -1,17 +1,17 @@ error[E0080]: transmuting from 4-byte type to 8-byte type: `[u8; 4]` -> `u64` - --> tests/ui-nightly/include_value_wrong_size.rs:15:25 + --> tests/ui-nightly/include_value_wrong_size.rs:12:25 | -15 | const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `WRONG_SIZE` failed here +12 | const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `WRONG_SIZE` failed here | - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/include_value_wrong_size.rs:15:25 + --> tests/ui-nightly/include_value_wrong_size.rs:12:25 | -15 | const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12 | const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `[u8; 4]` (32 bits) = note: target type: `u64` (64 bits) - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/invalid-impls/invalid-impls.rs b/tests/ui-nightly/invalid-impls/invalid-impls.rs index 78f40e844b..8a70bb1746 100644 --- a/tests/ui-nightly/invalid-impls/invalid-impls.rs +++ b/tests/ui-nightly/invalid-impls/invalid-impls.rs @@ -9,7 +9,6 @@ // Since some macros from `macros.rs` are unused. #![allow(unused)] -extern crate zerocopy; extern crate zerocopy_derive; include!("../../../src/util/macros.rs"); diff --git a/tests/ui-nightly/invalid-impls/invalid-impls.stderr b/tests/ui-nightly/invalid-impls/invalid-impls.stderr index 169f5d19c6..b16c69d0f4 100644 --- a/tests/ui-nightly/invalid-impls/invalid-impls.stderr +++ b/tests/ui-nightly/invalid-impls/invalid-impls.stderr @@ -1,14 +1,14 @@ error[E0277]: the trait bound `T: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:27:43 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:26:43 | - 27 | impl_or_verify!(T => TryFromBytes for Foo); + 26 | impl_or_verify!(T => TryFromBytes for Foo); | ^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `T` | = note: Consider adding `#[derive(TryFromBytes)]` to `T` note: required for `Foo` to implement `zerocopy::TryFromBytes` - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-nightly/invalid-impls/../../../src/util/macros.rs @@ -16,27 +16,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:27:5 + ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:26:5 | - 27 | impl_or_verify!(T => TryFromBytes for Foo); + 26 | impl_or_verify!(T => TryFromBytes for Foo); | --------------------------------------------- in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `TryFromBytes` | - 27 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); + 26 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); | ++++++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromZeros` is not satisfied - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:28:40 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:27:40 | - 28 | impl_or_verify!(T => FromZeros for Foo); + 27 | impl_or_verify!(T => FromZeros for Foo); | ^^^^^^ the trait `zerocopy::FromZeros` is not implemented for `T` | = note: Consider adding `#[derive(FromZeros)]` to `T` note: required for `Foo` to implement `zerocopy::FromZeros` - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-nightly/invalid-impls/../../../src/util/macros.rs @@ -44,27 +44,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:28:5 + ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:27:5 | - 28 | impl_or_verify!(T => FromZeros for Foo); + 27 | impl_or_verify!(T => FromZeros for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `FromZeros` | - 28 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); + 27 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:29:40 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:28:40 | - 29 | impl_or_verify!(T => FromBytes for Foo); + 28 | impl_or_verify!(T => FromBytes for Foo); | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T` | = note: Consider adding `#[derive(FromBytes)]` to `T` note: required for `Foo` to implement `zerocopy::FromBytes` - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-nightly/invalid-impls/../../../src/util/macros.rs @@ -72,27 +72,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:29:5 + ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:28:5 | - 29 | impl_or_verify!(T => FromBytes for Foo); + 28 | impl_or_verify!(T => FromBytes for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `FromBytes` | - 29 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); + 28 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:30:40 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:29:40 | - 30 | impl_or_verify!(T => IntoBytes for Foo); + 29 | impl_or_verify!(T => IntoBytes for Foo); | ^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `T` | = note: Consider adding `#[derive(IntoBytes)]` to `T` note: required for `Foo` to implement `zerocopy::IntoBytes` - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:21 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:21:21 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-nightly/invalid-impls/../../../src/util/macros.rs @@ -100,27 +100,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:30:5 + ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:29:5 | - 30 | impl_or_verify!(T => IntoBytes for Foo); + 29 | impl_or_verify!(T => IntoBytes for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `IntoBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `IntoBytes` | - 30 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); + 29 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:31:40 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:30:40 | - 31 | impl_or_verify!(T => Unaligned for Foo); + 30 | impl_or_verify!(T => Unaligned for Foo); | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T` | = note: Consider adding `#[derive(Unaligned)]` to `T` note: required for `Foo` to implement `zerocopy::Unaligned` - --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:32 + --> tests/ui-nightly/invalid-impls/invalid-impls.rs:21:32 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-nightly/invalid-impls/../../../src/util/macros.rs @@ -128,12 +128,12 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:31:5 + ::: tests/ui-nightly/invalid-impls/invalid-impls.rs:30:5 | - 31 | impl_or_verify!(T => Unaligned for Foo); + 30 | impl_or_verify!(T => Unaligned for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `Unaligned` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `Unaligned` | - 31 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); + 30 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); | +++++++++++++++++++++ diff --git a/tests/ui-nightly/transmute-dst-not-frombytes.rs b/tests/ui-nightly/transmute-dst-not-frombytes.rs index 7b5098e58d..3daed1c842 100644 --- a/tests/ui-nightly/transmute-dst-not-frombytes.rs +++ b/tests/ui-nightly/transmute-dst-not-frombytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::transmute; diff --git a/tests/ui-nightly/transmute-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-dst-not-frombytes.stderr index 9a3ed77475..abe4bf0572 100644 --- a/tests/ui-nightly/transmute-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-dst-not-frombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/transmute-dst-not-frombytes.rs:19:41 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-nightly/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,9 +21,9 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `DST_NOT_FROM_BYTES::transmute` - --> tests/ui-nightly/transmute-dst-not-frombytes.rs:19:41 + --> tests/ui-nightly/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-nightly/transmute-mut-const.rs b/tests/ui-nightly/transmute-mut-const.rs index 47372b1be4..9bee817cf6 100644 --- a/tests/ui-nightly/transmute-mut-const.rs +++ b/tests/ui-nightly/transmute-mut-const.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use zerocopy::transmute_mut; diff --git a/tests/ui-nightly/transmute-mut-const.stderr b/tests/ui-nightly/transmute-mut-const.stderr index 9396f611f4..2a1f3f5131 100644 --- a/tests/ui-nightly/transmute-mut-const.stderr +++ b/tests/ui-nightly/transmute-mut-const.stderr @@ -1,22 +1,22 @@ warning: taking a mutable reference to a `const` item - --> tests/ui-nightly/transmute-mut-const.rs:20:52 + --> tests/ui-nightly/transmute-mut-const.rs:18:52 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^ | = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here - --> tests/ui-nightly/transmute-mut-const.rs:17:1 + --> tests/ui-nightly/transmute-mut-const.rs:15:1 | -17 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; +15 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(const_item_mutation)]` on by default error[E0015]: cannot call non-const method `Wrap::<&mut [u8; 2], &mut [u8; 2]>::transmute_mut` in constants - --> tests/ui-nightly/transmute-mut-const.rs:20:37 + --> tests/ui-nightly/transmute-mut-const.rs:18:37 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants diff --git a/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs b/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs index 33a9ecd955..8f2d511cca 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs +++ b/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr b/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr index f1c445813c..c395466815 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +++ b/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-mut-dst-not-a-reference.rs:17:36 + --> tests/ui-nightly/transmute-mut-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _` | = note: expected type `usize` diff --git a/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs b/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs index 0039075596..504c12ac7e 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs +++ b/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr index de92afb002..91b3eff87b 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-nightly/transmute-mut-dst-not-frombytes.rs:24:38 + --> tests/ui-nightly/transmute-mut-dst-not-frombytes.rs:22:38 | - 24 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-nightly/transmute-mut-dst-not-frombytes.rs:21:1 + --> tests/ui-nightly/transmute-mut-dst-not-frombytes.rs:19:1 | - 21 | struct Dst; + 19 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: diff --git a/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs b/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs index 27cf93ae68..7c9d60e6e0 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs +++ b/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr b/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr index 30bd62acc1..3a3ce24d88 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr +++ b/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-mut-dst-not-intobytes.rs:24:36 + --> tests/ui-nightly/transmute-mut-dst-not-intobytes.rs:22:36 | - 24 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-nightly/transmute-mut-dst-not-intobytes.rs:21:1 + --> tests/ui-nightly/transmute-mut-dst-not-intobytes.rs:19:1 | - 21 | struct Dst; + 19 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-nightly/transmute-mut-dst-unsized.rs b/tests/ui-nightly/transmute-mut-dst-unsized.rs index 693ccda56f..6d9eb04da5 100644 --- a/tests/ui-nightly/transmute-mut-dst-unsized.rs +++ b/tests/ui-nightly/transmute-mut-dst-unsized.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-dst-unsized.stderr b/tests/ui-nightly/transmute-mut-dst-unsized.stderr index 225498a058..0a4611748f 100644 --- a/tests/ui-nightly/transmute-mut-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-nightly/transmute-mut-dst-unsized.rs:17:32 + --> tests/ui-nightly/transmute-mut-dst-unsized.rs:15:32 | - 17 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); + 15 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-nightly/transmute-mut-src-dst-not-references.rs b/tests/ui-nightly/transmute-mut-src-dst-not-references.rs index 98cc520889..d07829de05 100644 --- a/tests/ui-nightly/transmute-mut-src-dst-not-references.rs +++ b/tests/ui-nightly/transmute-mut-src-dst-not-references.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr b/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr index df3cf2dba0..ffe1ab4f74 100644 --- a/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr +++ b/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-mut-src-dst-not-references.rs:17:59 + --> tests/ui-nightly/transmute-mut-src-dst-not-references.rs:15:59 | -17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); +15 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider mutably borrowing here | -17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(&mut 0usize); +15 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(&mut 0usize); | ++++ diff --git a/tests/ui-nightly/transmute-mut-src-immutable.rs b/tests/ui-nightly/transmute-mut-src-immutable.rs index 08088d0db6..2d6e84542a 100644 --- a/tests/ui-nightly/transmute-mut-src-immutable.rs +++ b/tests/ui-nightly/transmute-mut-src-immutable.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-immutable.stderr b/tests/ui-nightly/transmute-mut-src-immutable.stderr index 7b7969d5d5..75924df3c6 100644 --- a/tests/ui-nightly/transmute-mut-src-immutable.stderr +++ b/tests/ui-nightly/transmute-mut-src-immutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-mut-src-immutable.rs:17:37 + --> tests/ui-nightly/transmute-mut-src-immutable.rs:15:37 | -17 | let _: &mut u8 = transmute_mut!(&0u8); +15 | let _: &mut u8 = transmute_mut!(&0u8); | ---------------^^^^- | | | | | types differ in mutability diff --git a/tests/ui-nightly/transmute-mut-src-not-a-reference.rs b/tests/ui-nightly/transmute-mut-src-not-a-reference.rs index bf8bc32592..71f6e67586 100644 --- a/tests/ui-nightly/transmute-mut-src-not-a-reference.rs +++ b/tests/ui-nightly/transmute-mut-src-not-a-reference.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr b/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr index 12b7674f0e..3cc9126c90 100644 --- a/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr +++ b/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:17:53 + --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:15:53 | -17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); +15 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider mutably borrowing here | -17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize); +15 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize); | ++++ diff --git a/tests/ui-nightly/transmute-mut-src-not-frombytes.rs b/tests/ui-nightly/transmute-mut-src-not-frombytes.rs index 0fc6f984b3..fbf6232cab 100644 --- a/tests/ui-nightly/transmute-mut-src-not-frombytes.rs +++ b/tests/ui-nightly/transmute-mut-src-not-frombytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr b/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr index dbf8dda209..863a91a5c2 100644 --- a/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:24:38 + --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:22:38 | - 24 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Src` - --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:17:1 + --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:15:1 | - 17 | struct Src; + 15 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Src` = help: the following other types implement trait `FromBytes`: diff --git a/tests/ui-nightly/transmute-mut-src-not-intobytes.rs b/tests/ui-nightly/transmute-mut-src-not-intobytes.rs index 518402df91..505734ac3d 100644 --- a/tests/ui-nightly/transmute-mut-src-not-intobytes.rs +++ b/tests/ui-nightly/transmute-mut-src-not-intobytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr b/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr index eef8bd1d4c..aee862ff69 100644 --- a/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr +++ b/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-mut-src-not-intobytes.rs:24:36 + --> tests/ui-nightly/transmute-mut-src-not-intobytes.rs:22:36 | - 24 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Src` - --> tests/ui-nightly/transmute-mut-src-not-intobytes.rs:17:1 + --> tests/ui-nightly/transmute-mut-src-not-intobytes.rs:15:1 | - 17 | struct Src; + 15 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-nightly/transmute-mut-src-unsized.rs b/tests/ui-nightly/transmute-mut-src-unsized.rs index 473070aecb..af2ffd363f 100644 --- a/tests/ui-nightly/transmute-mut-src-unsized.rs +++ b/tests/ui-nightly/transmute-mut-src-unsized.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; fn main() {} diff --git a/tests/ui-nightly/transmute-mut-src-unsized.stderr b/tests/ui-nightly/transmute-mut-src-unsized.stderr index 4b99fa6c42..8e1b872c58 100644 --- a/tests/ui-nightly/transmute-mut-src-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-nightly/transmute-mut-src-unsized.rs:17:35 + --> tests/ui-nightly/transmute-mut-src-unsized.rs:15:35 | -17 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); +15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()` | = note: required for `Wrap<&mut [u8], &mut [u8; 1]>` to implement `TransmuteMutDst<'_>` diff --git a/tests/ui-nightly/transmute-ptr-to-usize.rs b/tests/ui-nightly/transmute-ptr-to-usize.rs index 5af8859332..27db0bbb97 100644 --- a/tests/ui-nightly/transmute-ptr-to-usize.rs +++ b/tests/ui-nightly/transmute-ptr-to-usize.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute; fn main() {} diff --git a/tests/ui-nightly/transmute-ptr-to-usize.stderr b/tests/ui-nightly/transmute-ptr-to-usize.stderr index a9b60b937f..64b3c5f9a5 100644 --- a/tests/ui-nightly/transmute-ptr-to-usize.stderr +++ b/tests/ui-nightly/transmute-ptr-to-usize.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-nightly/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | the trait `IntoBytes` is not implemented for `*const usize` @@ -19,9 +19,9 @@ help: the trait `IntoBytes` is implemented for `usize` | unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes); | ----------------------------------------------------------------------------- in this macro invocation note: required by a bound in `POINTER_VALUE::transmute` - --> tests/ui-nightly/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-nightly/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-nightly/transmute-ref-dst-mutable.rs b/tests/ui-nightly/transmute-ref-dst-mutable.rs index fa0e6e4c9b..75f837acb0 100644 --- a/tests/ui-nightly/transmute-ref-dst-mutable.rs +++ b/tests/ui-nightly/transmute-ref-dst-mutable.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-dst-mutable.stderr b/tests/ui-nightly/transmute-ref-dst-mutable.stderr index 0cbdd176b8..bbe8c1c9f3 100644 --- a/tests/ui-nightly/transmute-ref-dst-mutable.stderr +++ b/tests/ui-nightly/transmute-ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-nightly/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-nightly/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-nightly/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` diff --git a/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs b/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs index de55f9acdf..f6dbd00599 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs +++ b/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr b/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr index 847d54732e..6cedd6496b 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +++ b/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` diff --git a/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs b/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs index f7619d34ef..969e8877b6 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs +++ b/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute_ref; diff --git a/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr index 4e01b16a2c..4cdac53c23 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Dst: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:23:34 +error[E0277]: the trait bound `Dst: FromBytes` is not satisfied + --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::FromBytes` is not implemented for `Dst` - --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:20:1 +help: the trait `FromBytes` is not implemented for `Dst` + --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:18:1 | -20 | struct Dst(AU16); +18 | struct Dst(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -24,8 +24,8 @@ help: the trait `zerocopy::FromBytes` is not implemented for `Dst` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `AssertDstIsFromBytes` - --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:23:34 + --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertDstIsFromBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/transmute-ref-dst-not-nocell.rs b/tests/ui-nightly/transmute-ref-dst-not-nocell.rs index f1f63bfcfd..4f21b72733 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-nocell.rs +++ b/tests/ui-nightly/transmute-ref-dst-not-nocell.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute_ref; diff --git a/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr b/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr index a96d25309d..ca4b8eb77b 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr +++ b/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Dst: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:23:33 +error[E0277]: the trait bound `Dst: Immutable` is not satisfied + --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::Immutable` is not implemented for `Dst` - --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Dst` + --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:18:1 | -20 | struct Dst(AU16); +18 | struct Dst(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Dst` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -24,8 +24,8 @@ help: the trait `zerocopy::Immutable` is not implemented for `Dst` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertDstIsImmutable` - --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:23:33 + --> tests/ui-nightly/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertDstIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/transmute-ref-dst-unsized.rs b/tests/ui-nightly/transmute-ref-dst-unsized.rs index 625f1fac07..3fc938bc15 100644 --- a/tests/ui-nightly/transmute-ref-dst-unsized.rs +++ b/tests/ui-nightly/transmute-ref-dst-unsized.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-dst-unsized.stderr b/tests/ui-nightly/transmute-ref-dst-unsized.stderr index bc7d1b99f6..726aeb316a 100644 --- a/tests/ui-nightly/transmute-ref-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-nightly/transmute-ref-dst-unsized.rs:17:28 + --> tests/ui-nightly/transmute-ref-dst-unsized.rs:15:28 | - 17 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); + 15 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-nightly/transmute-ref-src-dst-not-references.rs b/tests/ui-nightly/transmute-ref-src-dst-not-references.rs index 114e917b54..c65bd24a93 100644 --- a/tests/ui-nightly/transmute-ref-src-dst-not-references.rs +++ b/tests/ui-nightly/transmute-ref-src-dst-not-references.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr b/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr index 0f1f7fc7b3..65598a4c64 100644 --- a/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +++ b/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:17:54 + --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:15:54 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected `&_`, found `usize` @@ -11,13 +11,13 @@ error[E0308]: mismatched types found type `usize` help: consider borrowing here | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(&0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(&0usize); | + error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -25,9 +25,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -35,9 +35,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` diff --git a/tests/ui-nightly/transmute-ref-src-not-a-reference.rs b/tests/ui-nightly/transmute-ref-src-not-a-reference.rs index 90661b3e2c..7bbba06e15 100644 --- a/tests/ui-nightly/transmute-ref-src-not-a-reference.rs +++ b/tests/ui-nightly/transmute-ref-src-not-a-reference.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr b/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr index be477c6c5e..bd66af374d 100644 --- a/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr +++ b/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/transmute-ref-src-not-a-reference.rs:17:49 + --> tests/ui-nightly/transmute-ref-src-not-a-reference.rs:15:49 | -17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); +15 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected `&_`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider borrowing here | -17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize); +15 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize); | + diff --git a/tests/ui-nightly/transmute-ref-src-not-intobytes.rs b/tests/ui-nightly/transmute-ref-src-not-intobytes.rs index a5146fa8f2..8f357c92aa 100644 --- a/tests/ui-nightly/transmute-ref-src-not-intobytes.rs +++ b/tests/ui-nightly/transmute-ref-src-not-intobytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute_ref; diff --git a/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr b/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr index 1e874d654c..99c816d803 100644 --- a/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr +++ b/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `Src` - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:20:1 +help: the trait `IntoBytes` is not implemented for `Src` + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -24,25 +24,25 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `Src` AtomicIsize and $N others note: required by a bound in `AssertSrcIsIntoBytes` - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsIntoBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `Src` - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:20:1 +help: the trait `IntoBytes` is not implemented for `Src` + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -53,8 +53,8 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `Src` AtomicIsize and $N others note: required by a bound in `AssertSrcIsIntoBytes` - --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-nightly/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsIntoBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/transmute-ref-src-not-nocell.rs b/tests/ui-nightly/transmute-ref-src-not-nocell.rs index ee28a98dc4..862951b888 100644 --- a/tests/ui-nightly/transmute-ref-src-not-nocell.rs +++ b/tests/ui-nightly/transmute-ref-src-not-nocell.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute_ref; diff --git a/tests/ui-nightly/transmute-ref-src-not-nocell.stderr b/tests/ui-nightly/transmute-ref-src-not-nocell.stderr index 17debd8c91..338ca7e46a 100644 --- a/tests/ui-nightly/transmute-ref-src-not-nocell.stderr +++ b/tests/ui-nightly/transmute-ref-src-not-nocell.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::Immutable` is not implemented for `Src` - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Src` + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Src` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -24,25 +24,25 @@ help: the trait `zerocopy::Immutable` is not implemented for `Src` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertSrcIsImmutable` - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `Src` - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Src` + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Src` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -53,8 +53,8 @@ help: the trait `zerocopy::Immutable` is not implemented for `Src` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertSrcIsImmutable` - --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-nightly/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-nightly/transmute-ref-src-unsized.rs b/tests/ui-nightly/transmute-ref-src-unsized.rs index 14e72b4ddc..262395bd73 100644 --- a/tests/ui-nightly/transmute-ref-src-unsized.rs +++ b/tests/ui-nightly/transmute-ref-src-unsized.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_ref; fn main() {} diff --git a/tests/ui-nightly/transmute-ref-src-unsized.stderr b/tests/ui-nightly/transmute-ref-src-unsized.stderr index cd4d16a0c3..7b5d922a90 100644 --- a/tests/ui-nightly/transmute-ref-src-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-nightly/transmute-ref-src-unsized.rs:16:31 + --> tests/ui-nightly/transmute-ref-src-unsized.rs:14:31 | -16 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); +14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()` | = note: required for `Wrap<&[u8], &[u8; 1]>` to implement `TransmuteRefDst<'_>` diff --git a/tests/ui-nightly/transmute-size-decrease.rs b/tests/ui-nightly/transmute-size-decrease.rs index 567b6733f7..98d00e1950 100644 --- a/tests/ui-nightly/transmute-size-decrease.rs +++ b/tests/ui-nightly/transmute-size-decrease.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute; diff --git a/tests/ui-nightly/transmute-size-decrease.stderr b/tests/ui-nightly/transmute-size-decrease.stderr index c5345e3767..aca5fa9be5 100644 --- a/tests/ui-nightly/transmute-size-decrease.stderr +++ b/tests/ui-nightly/transmute-size-decrease.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 2-byte type to 1-byte type: `AU16` -> `u8` - --> tests/ui-nightly/transmute-size-decrease.rs:20:27 + --> tests/ui-nightly/transmute-size-decrease.rs:18:27 | -20 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); +18 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ evaluation of `DECREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/transmute-size-decrease.rs:20:27 + --> tests/ui-nightly/transmute-size-decrease.rs:18:27 | -20 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); +18 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-nightly/transmute-size-increase-allow-shrink.rs b/tests/ui-nightly/transmute-size-increase-allow-shrink.rs index 4922373ff9..1a0569aa34 100644 --- a/tests/ui-nightly/transmute-size-increase-allow-shrink.rs +++ b/tests/ui-nightly/transmute-size-increase-allow-shrink.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute; diff --git a/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr b/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr index 4602bdb61f..3fde7cc324 100644 --- a/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr +++ b/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 1-byte type to 2-byte type: `u8` -> `Transmute` - --> tests/ui-nightly/transmute-size-increase-allow-shrink.rs:20:29 + --> tests/ui-nightly/transmute-size-increase-allow-shrink.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INCREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/transmute-size-increase-allow-shrink.rs:20:29 + --> tests/ui-nightly/transmute-size-increase-allow-shrink.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-nightly/transmute-size-increase.rs b/tests/ui-nightly/transmute-size-increase.rs index 35dc780eae..06e1990bda 100644 --- a/tests/ui-nightly/transmute-size-increase.rs +++ b/tests/ui-nightly/transmute-size-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::transmute; diff --git a/tests/ui-nightly/transmute-size-increase.stderr b/tests/ui-nightly/transmute-size-increase.stderr index 5758a0956c..599dc541b9 100644 --- a/tests/ui-nightly/transmute-size-increase.stderr +++ b/tests/ui-nightly/transmute-size-increase.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 1-byte type to 2-byte type: `u8` -> `AU16` - --> tests/ui-nightly/transmute-size-increase.rs:20:29 + --> tests/ui-nightly/transmute-size-increase.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(0u8); | ^^^^^^^^^^^^^^^ evaluation of `INCREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/transmute-size-increase.rs:20:29 + --> tests/ui-nightly/transmute-size-increase.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(0u8); | ^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-nightly/transmute-src-not-intobytes.rs b/tests/ui-nightly/transmute-src-not-intobytes.rs index 73be6c1b74..3c9ac6625a 100644 --- a/tests/ui-nightly/transmute-src-not-intobytes.rs +++ b/tests/ui-nightly/transmute-src-not-intobytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::transmute; diff --git a/tests/ui-nightly/transmute-src-not-intobytes.stderr b/tests/ui-nightly/transmute-src-not-intobytes.stderr index aae3923853..68841b35dc 100644 --- a/tests/ui-nightly/transmute-src-not-intobytes.stderr +++ b/tests/ui-nightly/transmute-src-not-intobytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/transmute-src-not-intobytes.rs:19:32 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -24,9 +24,9 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `SRC_NOT_AS_BYTES::transmute` - --> tests/ui-nightly/transmute-src-not-intobytes.rs:19:32 + --> tests/ui-nightly/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs b/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs index 0658bccf15..1a9fdeb2fb 100644 --- a/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs +++ b/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::try_transmute; diff --git a/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr b/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr index 28ce2ebd2a..a8581862a5 100644 --- a/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr +++ b/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:17:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:15:33 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:15:58 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute` | ^^^^^^^^^^^^ required by this bound in `try_transmute` = note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs:15:58 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-nightly/try_transmute-size-decrease.rs b/tests/ui-nightly/try_transmute-size-decrease.rs index 097623c87e..74c45cf87f 100644 --- a/tests/ui-nightly/try_transmute-size-decrease.rs +++ b/tests/ui-nightly/try_transmute-size-decrease.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute; diff --git a/tests/ui-nightly/try_transmute-size-decrease.stderr b/tests/ui-nightly/try_transmute-size-decrease.stderr index 4cb923729b..c9faceb34e 100644 --- a/tests/ui-nightly/try_transmute-size-decrease.stderr +++ b/tests/ui-nightly/try_transmute-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute-size-decrease.rs:19:41 + --> tests/ui-nightly/try_transmute-size-decrease.rs:17:41 | -19 | let _decrease_size: Result = try_transmute!(AU16(0)); +17 | let _decrease_size: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-nightly/try_transmute-size-increase.rs b/tests/ui-nightly/try_transmute-size-increase.rs index 4b40a56693..05dfe05370 100644 --- a/tests/ui-nightly/try_transmute-size-increase.rs +++ b/tests/ui-nightly/try_transmute-size-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute; diff --git a/tests/ui-nightly/try_transmute-size-increase.stderr b/tests/ui-nightly/try_transmute-size-increase.stderr index 26d2876651..e912d389a9 100644 --- a/tests/ui-nightly/try_transmute-size-increase.stderr +++ b/tests/ui-nightly/try_transmute-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute-size-increase.rs:19:43 + --> tests/ui-nightly/try_transmute-size-increase.rs:17:43 | -19 | let _increase_size: Result = try_transmute!(0u8); +17 | let _increase_size: Result = try_transmute!(0u8); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-nightly/try_transmute-src-not-intobytes.rs b/tests/ui-nightly/try_transmute-src-not-intobytes.rs index c2a7b41732..304fb004b5 100644 --- a/tests/ui-nightly/try_transmute-src-not-intobytes.rs +++ b/tests/ui-nightly/try_transmute-src-not-intobytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::try_transmute; diff --git a/tests/ui-nightly/try_transmute-src-not-intobytes.stderr b/tests/ui-nightly/try_transmute-src-not-intobytes.stderr index 6c29ac4eb6..8ac913fd9c 100644 --- a/tests/ui-nightly/try_transmute-src-not-intobytes.stderr +++ b/tests/ui-nightly/try_transmute-src-not-intobytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute-src-not-intobytes.rs:18:47 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/try_transmute-src-not-intobytes.rs:16:47 | - 18 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); + 16 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool diff --git a/tests/ui-nightly/try_transmute_mut-alignment-increase.rs b/tests/ui-nightly/try_transmute_mut-alignment-increase.rs index d9c9a9dc3a..dfeaf8f3d8 100644 --- a/tests/ui-nightly/try_transmute_mut-alignment-increase.rs +++ b/tests/ui-nightly/try_transmute_mut-alignment-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_mut; diff --git a/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr b/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr index 50a3f0c959..1db93ba3e1 100644 --- a/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr +++ b/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_mut-alignment-increase.rs:20:48 + --> tests/ui-nightly/try_transmute_mut-alignment-increase.rs:18:48 | -20 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs b/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs index 89096cd1d8..f8abd132c7 100644 --- a/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs +++ b/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::try_transmute_mut; diff --git a/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr b/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr index 5c1e2c4473..e56dba5a74 100644 --- a/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +++ b/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:20:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:33 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -90,19 +90,19 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-nightly/try_transmute_mut-size-decrease.rs b/tests/ui-nightly/try_transmute_mut-size-decrease.rs index 3d522efd1a..f2db6c90f1 100644 --- a/tests/ui-nightly/try_transmute_mut-size-decrease.rs +++ b/tests/ui-nightly/try_transmute_mut-size-decrease.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_mut; diff --git a/tests/ui-nightly/try_transmute_mut-size-decrease.stderr b/tests/ui-nightly/try_transmute_mut-size-decrease.stderr index fe0494aeb6..69b74b79a5 100644 --- a/tests/ui-nightly/try_transmute_mut-size-decrease.stderr +++ b/tests/ui-nightly/try_transmute_mut-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_mut-size-decrease.rs:20:46 + --> tests/ui-nightly/try_transmute_mut-size-decrease.rs:18:46 | -20 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); +18 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-nightly/try_transmute_mut-size-increase.rs b/tests/ui-nightly/try_transmute_mut-size-increase.rs index 526d465cdd..0ef5317bf2 100644 --- a/tests/ui-nightly/try_transmute_mut-size-increase.rs +++ b/tests/ui-nightly/try_transmute_mut-size-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_mut; diff --git a/tests/ui-nightly/try_transmute_mut-size-increase.stderr b/tests/ui-nightly/try_transmute_mut-size-increase.stderr index 1e33cef899..573ab9f318 100644 --- a/tests/ui-nightly/try_transmute_mut-size-increase.stderr +++ b/tests/ui-nightly/try_transmute_mut-size-increase.stderr @@ -1,15 +1,15 @@ warning: unused import: `util::AU16` - --> tests/ui-nightly/try_transmute_mut-size-increase.rs:13:5 + --> tests/ui-nightly/try_transmute_mut-size-increase.rs:11:5 | -13 | use util::AU16; +11 | use util::AU16; | ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_mut-size-increase.rs:20:51 + --> tests/ui-nightly/try_transmute_mut-size-increase.rs:18:51 | -20 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs b/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs index 12b2e0d328..d47321e000 100644 --- a/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs +++ b/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; #[derive(zerocopy::IntoBytes)] diff --git a/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr b/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr index 0b0e2f47c2..8eaa11b931 100644 --- a/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr +++ b/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Src` - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:15:1 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:13:1 | - 15 | struct Src; + 13 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Src` = help: the following other types implement trait `FromBytes`: @@ -31,15 +31,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:19:1 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: @@ -63,15 +63,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:19:1 + --> tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs b/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs index fa3b7032d0..ff53576693 100644 --- a/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs +++ b/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::transmute_mut; #[derive(zerocopy::FromBytes)] diff --git a/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr b/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr index 21c4a851f6..32a1f6f1bd 100644 --- a/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr +++ b/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Src` - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:15:1 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:13:1 | - 15 | struct Src; + 13 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` = help: the following other types implement trait `IntoBytes`: @@ -31,15 +31,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:19:1 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: @@ -63,15 +63,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:19:1 + --> tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-nightly/try_transmute_ref-alignment-increase.rs b/tests/ui-nightly/try_transmute_ref-alignment-increase.rs index ad1062fb31..8427d0e452 100644 --- a/tests/ui-nightly/try_transmute_ref-alignment-increase.rs +++ b/tests/ui-nightly/try_transmute_ref-alignment-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_ref; diff --git a/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr b/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr index 790a0e4e62..9fdd0ed163 100644 --- a/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr +++ b/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_ref-alignment-increase.rs:19:44 + --> tests/ui-nightly/try_transmute_ref-alignment-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-nightly/try_transmute_ref-dst-mutable.rs b/tests/ui-nightly/try_transmute_ref-dst-mutable.rs index e27a12948d..2f64893ebf 100644 --- a/tests/ui-nightly/try_transmute_ref-dst-mutable.rs +++ b/tests/ui-nightly/try_transmute_ref-dst-mutable.rs @@ -6,8 +6,6 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; - use zerocopy::try_transmute_ref; fn main() {} diff --git a/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr b/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr index 29d512817d..ec5a6a6818 100644 --- a/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr +++ b/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:16:33 | - 18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); + 16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | types differ in mutability @@ -10,9 +10,9 @@ error[E0308]: mismatched types = note: expected mutable reference `&mut u8` found reference `&_` help: the type constructed contains `&_` due to the type of the argument passed - --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:16:33 | - 18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); + 16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ this argument influences the type of `Ok` note: tuple variant defined here --> $RUST/core/src/result.rs @@ -22,9 +22,9 @@ note: tuple variant defined here = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-nightly/try_transmute_ref-dst-mutable.rs:16:33 | -18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); +16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected enum `Result<&mut u8, _>` diff --git a/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs b/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs index 3928a1cb2a..078369342c 100644 --- a/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +++ b/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::try_transmute_ref; diff --git a/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr b/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr index f982f3a23a..a5e0ea8ca2 100644 --- a/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +++ b/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:33 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -90,19 +90,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-nightly/try_transmute_ref-size-decrease.rs b/tests/ui-nightly/try_transmute_ref-size-decrease.rs index 60bd70c248..62027e1efe 100644 --- a/tests/ui-nightly/try_transmute_ref-size-decrease.rs +++ b/tests/ui-nightly/try_transmute_ref-size-decrease.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_ref; diff --git a/tests/ui-nightly/try_transmute_ref-size-decrease.stderr b/tests/ui-nightly/try_transmute_ref-size-decrease.stderr index 9b9324387d..dd388069af 100644 --- a/tests/ui-nightly/try_transmute_ref-size-decrease.stderr +++ b/tests/ui-nightly/try_transmute_ref-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_ref-size-decrease.rs:19:42 + --> tests/ui-nightly/try_transmute_ref-size-decrease.rs:17:42 | -19 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); +17 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-nightly/try_transmute_ref-size-increase.rs b/tests/ui-nightly/try_transmute_ref-size-increase.rs index ee5a5fd431..9445940b20 100644 --- a/tests/ui-nightly/try_transmute_ref-size-increase.rs +++ b/tests/ui-nightly/try_transmute_ref-size-increase.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::AU16; use zerocopy::try_transmute_ref; diff --git a/tests/ui-nightly/try_transmute_ref-size-increase.stderr b/tests/ui-nightly/try_transmute_ref-size-increase.stderr index 08e511fce4..b5482a7fd4 100644 --- a/tests/ui-nightly/try_transmute_ref-size-increase.stderr +++ b/tests/ui-nightly/try_transmute_ref-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-nightly/try_transmute_ref-size-increase.rs:19:44 + --> tests/ui-nightly/try_transmute_ref-size-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs b/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs index 2aec95ae6c..593e68ffa7 100644 --- a/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs +++ b/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs @@ -6,9 +6,7 @@ // This file may not be copied, modified, or distributed except according to // those terms. -include!("../../zerocopy-derive/tests/include.rs"); - -extern crate zerocopy; +include!("../include.rs"); use util::{NotZerocopy, AU16}; use zerocopy::try_transmute_ref; diff --git a/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr b/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr index efb2296a29..39d87ec874 100644 --- a/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +++ b/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | - 19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + 17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -30,19 +30,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | - 19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + 17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-nightly/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-nightly/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () diff --git a/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr b/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr index 815b20c615..f28a0c7f0c 100644 --- a/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-from-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-from-bytes.rs:16:24 | -18 | takes_from_bytes::(); +16 | takes_from_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,7 +21,7 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_from_bytes` - --> tests/ui-stable/diagnostic-not-implemented-from-bytes.rs:21:24 + --> tests/ui-stable/diagnostic-not-implemented-from-bytes.rs:19:24 | -21 | fn takes_from_bytes() {} +19 | fn takes_from_bytes() {} | ^^^^^^^^^ required by this bound in `takes_from_bytes` diff --git a/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr b/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr index 8bea0161a8..820c3913ed 100644 --- a/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-from-zeros.rs:18:24 + --> tests/ui-stable/diagnostic-not-implemented-from-zeros.rs:16:24 | -18 | takes_from_zeros::(); +16 | takes_from_zeros::(); | ^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ help: the trait `FromZeros` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_from_zeros` - --> tests/ui-stable/diagnostic-not-implemented-from-zeros.rs:21:24 + --> tests/ui-stable/diagnostic-not-implemented-from-zeros.rs:19:24 | -21 | fn takes_from_zeros() {} +19 | fn takes_from_zeros() {} | ^^^^^^^^^ required by this bound in `takes_from_zeros` diff --git a/tests/ui-stable/diagnostic-not-implemented-immutable.stderr b/tests/ui-stable/diagnostic-not-implemented-immutable.stderr index 44e7212c0d..f225c0c3a6 100644 --- a/tests/ui-stable/diagnostic-not-implemented-immutable.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-immutable.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-immutable.rs:18:23 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-immutable.rs:16:23 | -18 | takes_immutable::(); +16 | takes_immutable::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -21,7 +21,7 @@ help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` (A, B, C, D, E, F) and $N others note: required by a bound in `takes_immutable` - --> tests/ui-stable/diagnostic-not-implemented-immutable.rs:21:23 + --> tests/ui-stable/diagnostic-not-implemented-immutable.rs:19:23 | -21 | fn takes_immutable() {} +19 | fn takes_immutable() {} | ^^^^^^^^^ required by this bound in `takes_immutable` diff --git a/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr b/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr index dc84aacc99..e8880baa56 100644 --- a/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-into-bytes.rs:18:24 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-into-bytes.rs:16:24 | -18 | takes_into_bytes::(); +16 | takes_into_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -21,7 +21,7 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `takes_into_bytes` - --> tests/ui-stable/diagnostic-not-implemented-into-bytes.rs:21:24 + --> tests/ui-stable/diagnostic-not-implemented-into-bytes.rs:19:24 | -21 | fn takes_into_bytes() {} +19 | fn takes_into_bytes() {} | ^^^^^^^^^ required by this bound in `takes_into_bytes` diff --git a/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr b/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr index cb4476e03d..8f17f04479 100644 --- a/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr @@ -1,38 +1,38 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); - | --------- ^^^^^^^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` +50 | Foo.write_obj(NotZerocopy(())); + | --------- ^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy` | | | required by a bound introduced by this call | note: required by a bound in `Foo::write_obj` - --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:58:21 + --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:56:21 | -58 | fn write_obj(&mut self, _val: T) {} +56 | fn write_obj(&mut self, _val: T) {} | ^^^^^^^^^ required by this bound in `Foo::write_obj` help: consider borrowing here | -52 | Foo.write_obj(&NotZerocopy(())); +50 | Foo.write_obj(&NotZerocopy(())); | + -52 | Foo.write_obj(&mut NotZerocopy(())); +50 | Foo.write_obj(&mut NotZerocopy(())); | ++++ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:52:19 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:50:19 | -52 | Foo.write_obj(NotZerocopy(())); +50 | Foo.write_obj(NotZerocopy(())); | --------- ^^^^^^^^^^^^^^^ unsatisfied trait bound | | | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -43,7 +43,7 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `Foo::write_obj` - --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:58:33 + --> tests/ui-stable/diagnostic-not-implemented-issue-1296.rs:56:33 | -58 | fn write_obj(&mut self, _val: T) {} +56 | fn write_obj(&mut self, _val: T) {} | ^^^^^^^^^ required by this bound in `Foo::write_obj` diff --git a/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr b/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr index 8ee5a62b00..acbb9209d6 100644 --- a/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::KnownLayout` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-known-layout.rs:18:26 +error[E0277]: the trait bound `NotZerocopy: KnownLayout` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-known-layout.rs:16:26 | -18 | takes_known_layout::(); +16 | takes_known_layout::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `KnownLayout` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `KnownLayout`: &T &mut T () @@ -21,7 +21,7 @@ help: the trait `zerocopy::KnownLayout` is not implemented for `NotZerocopy` AtomicI16 and $N others note: required by a bound in `takes_known_layout` - --> tests/ui-stable/diagnostic-not-implemented-known-layout.rs:21:26 + --> tests/ui-stable/diagnostic-not-implemented-known-layout.rs:19:26 | -21 | fn takes_known_layout() {} +19 | fn takes_known_layout() {} | ^^^^^^^^^^^ required by this bound in `takes_known_layout` diff --git a/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr b/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr index b291417f73..2ec88bb602 100644 --- a/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs:18:28 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs:16:28 | -18 | takes_try_from_bytes::(); +16 | takes_try_from_bytes::(); | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -21,7 +21,7 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `takes_try_from_bytes` - --> tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs:21:28 + --> tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs:19:28 | -21 | fn takes_try_from_bytes() {} +19 | fn takes_try_from_bytes() {} | ^^^^^^^^^^^^ required by this bound in `takes_try_from_bytes` diff --git a/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr b/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr index ae638f0ea9..1203f96044 100644 --- a/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr +++ b/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/diagnostic-not-implemented-unaligned.rs:18:23 + --> tests/ui-stable/diagnostic-not-implemented-unaligned.rs:16:23 | -18 | takes_unaligned::(); +16 | takes_unaligned::(); | ^^^^^^^^^^^ unsatisfied trait bound | help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` I128 and $N others note: required by a bound in `takes_unaligned` - --> tests/ui-stable/diagnostic-not-implemented-unaligned.rs:21:23 + --> tests/ui-stable/diagnostic-not-implemented-unaligned.rs:19:23 | -21 | fn takes_unaligned() {} +19 | fn takes_unaligned() {} | ^^^^^^^^^ required by this bound in `takes_unaligned` diff --git a/tests/ui-stable/include_value_not_from_bytes.stderr b/tests/ui-stable/include_value_not_from_bytes.stderr index 7e70aa0b69..32ebe7269a 100644 --- a/tests/ui-stable/include_value_not_from_bytes.stderr +++ b/tests/ui-stable/include_value_not_from_bytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/include_value_not_from_bytes.rs:19:42 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-stable/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,11 +21,11 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `NOT_FROM_BYTES::transmute` - --> tests/ui-stable/include_value_not_from_bytes.rs:19:42 + --> tests/ui-stable/include_value_not_from_bytes.rs:17:5 | -19 | const NOT_FROM_BYTES: NotZerocopy = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | required by a bound in this function - | required by this bound in `transmute` - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) +17 | zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | required by a bound in this function + | required by this bound in `transmute` + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/include_value_wrong_size.stderr b/tests/ui-stable/include_value_wrong_size.stderr index 9782163f08..3e5d0f52b6 100644 --- a/tests/ui-stable/include_value_wrong_size.stderr +++ b/tests/ui-stable/include_value_wrong_size.stderr @@ -1,17 +1,17 @@ error[E0080]: transmuting from 4-byte type to 8-byte type: `[u8; 4]` -> `u64` - --> tests/ui-stable/include_value_wrong_size.rs:15:25 + --> tests/ui-stable/include_value_wrong_size.rs:12:25 | -15 | const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `WRONG_SIZE` failed here +12 | const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `WRONG_SIZE` failed here | - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/include_value_wrong_size.rs:15:25 + --> tests/ui-stable/include_value_wrong_size.rs:12:25 | -15 | const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12 | const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `[u8; 4]` (32 bits) = note: target type: `u64` (64 bits) - = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `include_value` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::transmute` which comes from the expansion of the macro `zerocopy::include_value` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/invalid-impls/invalid-impls.stderr b/tests/ui-stable/invalid-impls/invalid-impls.stderr index 1d036ab888..dad5c7e195 100644 --- a/tests/ui-stable/invalid-impls/invalid-impls.stderr +++ b/tests/ui-stable/invalid-impls/invalid-impls.stderr @@ -7,24 +7,24 @@ warning: ambiguous glob re-exports | | } | |_^ the name `define_cast` in the macro namespace is first re-exported here | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:17:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:16:5 | - 17 | use zerocopy::*; + 16 | use zerocopy::*; | ----------- but the name `define_cast` in the macro namespace is also re-exported here | = note: `#[warn(ambiguous_glob_reexports)]` on by default error[E0277]: the trait bound `T: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/invalid-impls/invalid-impls.rs:27:43 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:26:43 | - 27 | impl_or_verify!(T => TryFromBytes for Foo); + 26 | impl_or_verify!(T => TryFromBytes for Foo); | ^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `T` | = note: Consider adding `#[derive(TryFromBytes)]` to `T` note: required for `Foo` to implement `zerocopy::TryFromBytes` - --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-stable/invalid-impls/../../../src/util/macros.rs @@ -32,27 +32,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:27:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:26:5 | - 27 | impl_or_verify!(T => TryFromBytes for Foo); + 26 | impl_or_verify!(T => TryFromBytes for Foo); | --------------------------------------------- in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `TryFromBytes` | - 27 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); + 26 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo); | ++++++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromZeros` is not satisfied - --> tests/ui-stable/invalid-impls/invalid-impls.rs:28:40 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:27:40 | - 28 | impl_or_verify!(T => FromZeros for Foo); + 27 | impl_or_verify!(T => FromZeros for Foo); | ^^^^^^ the trait `zerocopy::FromZeros` is not implemented for `T` | = note: Consider adding `#[derive(FromZeros)]` to `T` note: required for `Foo` to implement `zerocopy::FromZeros` - --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-stable/invalid-impls/../../../src/util/macros.rs @@ -60,27 +60,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:28:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:27:5 | - 28 | impl_or_verify!(T => FromZeros for Foo); + 27 | impl_or_verify!(T => FromZeros for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `FromZeros` | - 28 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); + 27 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/invalid-impls/invalid-impls.rs:29:40 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:28:40 | - 29 | impl_or_verify!(T => FromBytes for Foo); + 28 | impl_or_verify!(T => FromBytes for Foo); | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T` | = note: Consider adding `#[derive(FromBytes)]` to `T` note: required for `Foo` to implement `zerocopy::FromBytes` - --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:10 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:21:10 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-stable/invalid-impls/../../../src/util/macros.rs @@ -88,27 +88,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:29:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:28:5 | - 29 | impl_or_verify!(T => FromBytes for Foo); + 28 | impl_or_verify!(T => FromBytes for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `FromBytes` | - 29 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); + 28 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/invalid-impls/invalid-impls.rs:30:40 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:29:40 | - 30 | impl_or_verify!(T => IntoBytes for Foo); + 29 | impl_or_verify!(T => IntoBytes for Foo); | ^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `T` | = note: Consider adding `#[derive(IntoBytes)]` to `T` note: required for `Foo` to implement `zerocopy::IntoBytes` - --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:21 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:21:21 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-stable/invalid-impls/../../../src/util/macros.rs @@ -116,27 +116,27 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:30:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:29:5 | - 30 | impl_or_verify!(T => IntoBytes for Foo); + 29 | impl_or_verify!(T => IntoBytes for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `IntoBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `IntoBytes` | - 30 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); + 29 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo); | +++++++++++++++++++++ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/invalid-impls/invalid-impls.rs:31:40 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:30:40 | - 31 | impl_or_verify!(T => Unaligned for Foo); + 30 | impl_or_verify!(T => Unaligned for Foo); | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T` | = note: Consider adding `#[derive(Unaligned)]` to `T` note: required for `Foo` to implement `zerocopy::Unaligned` - --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:32 + --> tests/ui-stable/invalid-impls/invalid-impls.rs:21:32 | - 22 | #[derive(FromBytes, IntoBytes, Unaligned)] + 21 | #[derive(FromBytes, IntoBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::Subtrait` --> tests/ui-stable/invalid-impls/../../../src/util/macros.rs @@ -144,12 +144,12 @@ note: required by a bound in `_::Subtrait` | trait Subtrait: $trait {} | ^^^^^^ required by this bound in `Subtrait` | - ::: tests/ui-stable/invalid-impls/invalid-impls.rs:31:5 + ::: tests/ui-stable/invalid-impls/invalid-impls.rs:30:5 | - 31 | impl_or_verify!(T => Unaligned for Foo); + 30 | impl_or_verify!(T => Unaligned for Foo); | ------------------------------------------ in this macro invocation = note: this error originates in the derive macro `Unaligned` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `Unaligned` | - 31 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); + 30 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo); | +++++++++++++++++++++ diff --git a/tests/ui-stable/transmute-dst-not-frombytes.stderr b/tests/ui-stable/transmute-dst-not-frombytes.stderr index 550f142039..f8e2b4d872 100644 --- a/tests/ui-stable/transmute-dst-not-frombytes.stderr +++ b/tests/ui-stable/transmute-dst-not-frombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/transmute-dst-not-frombytes.rs:19:41 +error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied + --> tests/ui-stable/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `FromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -21,9 +21,9 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `DST_NOT_FROM_BYTES::transmute` - --> tests/ui-stable/transmute-dst-not-frombytes.rs:19:41 + --> tests/ui-stable/transmute-dst-not-frombytes.rs:17:41 | -19 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); +17 | const DST_NOT_FROM_BYTES: NotZerocopy = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-stable/transmute-mut-const.stderr b/tests/ui-stable/transmute-mut-const.stderr index d5c2aabfd0..8192730203 100644 --- a/tests/ui-stable/transmute-mut-const.stderr +++ b/tests/ui-stable/transmute-mut-const.stderr @@ -1,22 +1,22 @@ warning: taking a mutable reference to a `const` item - --> tests/ui-stable/transmute-mut-const.rs:20:52 + --> tests/ui-stable/transmute-mut-const.rs:18:52 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^ | = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here - --> tests/ui-stable/transmute-mut-const.rs:17:1 + --> tests/ui-stable/transmute-mut-const.rs:15:1 | -17 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; +15 | const ARRAY_OF_U8S: [u8; 2] = [0u8; 2]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(const_item_mutation)]` on by default error[E0015]: cannot call non-const method `Wrap::<&mut [u8; 2], &mut [u8; 2]>::transmute_mut` in constants - --> tests/ui-stable/transmute-mut-const.rs:20:37 + --> tests/ui-stable/transmute-mut-const.rs:18:37 | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); +18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants diff --git a/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr b/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr index 1f438badec..b11b702cc0 100644 --- a/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +++ b/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-mut-dst-not-a-reference.rs:17:36 + --> tests/ui-stable/transmute-mut-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _` | = note: expected type `usize` diff --git a/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr b/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr index 7aba82630f..d93ea8aa08 100644 --- a/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr +++ b/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-stable/transmute-mut-dst-not-frombytes.rs:24:38 + --> tests/ui-stable/transmute-mut-dst-not-frombytes.rs:22:38 | - 24 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const DST_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-stable/transmute-mut-dst-not-frombytes.rs:21:1 + --> tests/ui-stable/transmute-mut-dst-not-frombytes.rs:19:1 | - 21 | struct Dst; + 19 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: diff --git a/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr b/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr index 90088e267f..768e8bbb1b 100644 --- a/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr +++ b/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-stable/transmute-mut-dst-not-intobytes.rs:24:36 + --> tests/ui-stable/transmute-mut-dst-not-intobytes.rs:22:36 | - 24 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const DST_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-stable/transmute-mut-dst-not-intobytes.rs:21:1 + --> tests/ui-stable/transmute-mut-dst-not-intobytes.rs:19:1 | - 21 | struct Dst; + 19 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-stable/transmute-mut-dst-unsized.stderr b/tests/ui-stable/transmute-mut-dst-unsized.stderr index 5c8247118d..86c6cea970 100644 --- a/tests/ui-stable/transmute-mut-dst-unsized.stderr +++ b/tests/ui-stable/transmute-mut-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-stable/transmute-mut-dst-unsized.rs:17:32 + --> tests/ui-stable/transmute-mut-dst-unsized.rs:15:32 | - 17 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); + 15 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-stable/transmute-mut-src-dst-not-references.stderr b/tests/ui-stable/transmute-mut-src-dst-not-references.stderr index c0d9e0f0d3..758ed12deb 100644 --- a/tests/ui-stable/transmute-mut-src-dst-not-references.stderr +++ b/tests/ui-stable/transmute-mut-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-mut-src-dst-not-references.rs:17:59 + --> tests/ui-stable/transmute-mut-src-dst-not-references.rs:15:59 | -17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); +15 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider mutably borrowing here | -17 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(&mut 0usize); +15 | const SRC_DST_NOT_REFERENCES: &mut usize = transmute_mut!(&mut 0usize); | ++++ diff --git a/tests/ui-stable/transmute-mut-src-immutable.stderr b/tests/ui-stable/transmute-mut-src-immutable.stderr index 0115c791d3..4476fb134c 100644 --- a/tests/ui-stable/transmute-mut-src-immutable.stderr +++ b/tests/ui-stable/transmute-mut-src-immutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-mut-src-immutable.rs:17:37 + --> tests/ui-stable/transmute-mut-src-immutable.rs:15:37 | -17 | let _: &mut u8 = transmute_mut!(&0u8); +15 | let _: &mut u8 = transmute_mut!(&0u8); | ---------------^^^^- | | | | | types differ in mutability diff --git a/tests/ui-stable/transmute-mut-src-not-a-reference.stderr b/tests/ui-stable/transmute-mut-src-not-a-reference.stderr index 8c1d9b47ba..51dfa52071 100644 --- a/tests/ui-stable/transmute-mut-src-not-a-reference.stderr +++ b/tests/ui-stable/transmute-mut-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-mut-src-not-a-reference.rs:17:53 + --> tests/ui-stable/transmute-mut-src-not-a-reference.rs:15:53 | -17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); +15 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize); | ---------------^^^^^^- | | | | | expected `&mut _`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider mutably borrowing here | -17 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize); +15 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize); | ++++ diff --git a/tests/ui-stable/transmute-mut-src-not-frombytes.stderr b/tests/ui-stable/transmute-mut-src-not-frombytes.stderr index 6718eaac49..87e38e305b 100644 --- a/tests/ui-stable/transmute-mut-src-not-frombytes.stderr +++ b/tests/ui-stable/transmute-mut-src-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-stable/transmute-mut-src-not-frombytes.rs:24:38 + --> tests/ui-stable/transmute-mut-src-not-frombytes.rs:22:38 | - 24 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const SRC_NOT_FROM_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Src` - --> tests/ui-stable/transmute-mut-src-not-frombytes.rs:17:1 + --> tests/ui-stable/transmute-mut-src-not-frombytes.rs:15:1 | - 17 | struct Src; + 15 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Src` = help: the following other types implement trait `FromBytes`: diff --git a/tests/ui-stable/transmute-mut-src-not-intobytes.stderr b/tests/ui-stable/transmute-mut-src-not-intobytes.stderr index ac96b53c67..007edbf8f9 100644 --- a/tests/ui-stable/transmute-mut-src-not-intobytes.stderr +++ b/tests/ui-stable/transmute-mut-src-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-stable/transmute-mut-src-not-intobytes.rs:24:36 + --> tests/ui-stable/transmute-mut-src-not-intobytes.rs:22:36 | - 24 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); + 22 | const SRC_NOT_AS_BYTES: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Src` - --> tests/ui-stable/transmute-mut-src-not-intobytes.rs:17:1 + --> tests/ui-stable/transmute-mut-src-not-intobytes.rs:15:1 | - 17 | struct Src; + 15 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-stable/transmute-mut-src-unsized.stderr b/tests/ui-stable/transmute-mut-src-unsized.stderr index 4ef157ea23..bf4560a368 100644 --- a/tests/ui-stable/transmute-mut-src-unsized.stderr +++ b/tests/ui-stable/transmute-mut-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-stable/transmute-mut-src-unsized.rs:17:35 + --> tests/ui-stable/transmute-mut-src-unsized.rs:15:35 | -17 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); +15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()` | = note: required for `Wrap<&mut [u8], &mut [u8; 1]>` to implement `TransmuteMutDst<'_>` diff --git a/tests/ui-stable/transmute-ptr-to-usize.stderr b/tests/ui-stable/transmute-ptr-to-usize.stderr index a3b9f995d1..d5266cad92 100644 --- a/tests/ui-stable/transmute-ptr-to-usize.stderr +++ b/tests/ui-stable/transmute-ptr-to-usize.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied - --> tests/ui-stable/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-stable/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | the trait `IntoBytes` is not implemented for `*const usize` @@ -10,9 +10,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` note: required by a bound in `POINTER_VALUE::transmute` - --> tests/ui-stable/transmute-ptr-to-usize.rs:20:30 + --> tests/ui-stable/transmute-ptr-to-usize.rs:18:30 | -20 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); +18 | const POINTER_VALUE: usize = transmute!(&0usize as *const usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-stable/transmute-ref-dst-mutable.stderr b/tests/ui-stable/transmute-ref-dst-mutable.stderr index c70f6ea618..281714b257 100644 --- a/tests/ui-stable/transmute-ref-dst-mutable.stderr +++ b/tests/ui-stable/transmute-ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-stable/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-stable/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-mutable.rs:18:22 + --> tests/ui-stable/transmute-ref-dst-mutable.rs:16:22 | -18 | let _: &mut u8 = transmute_ref!(&0u8); +16 | let _: &mut u8 = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected mutable reference `&mut u8` diff --git a/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr b/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr index ab3f90c2fd..70a49e4e31 100644 --- a/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +++ b/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -9,9 +9,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -19,9 +19,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:17:36 + --> tests/ui-stable/transmute-ref-dst-not-a-reference.rs:15:36 | -17 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); +15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` diff --git a/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr b/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr index 20532a42ef..aecc775520 100644 --- a/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr +++ b/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Dst: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:23:34 +error[E0277]: the trait bound `Dst: FromBytes` is not satisfied + --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::FromBytes` is not implemented for `Dst` - --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:20:1 +help: the trait `FromBytes` is not implemented for `Dst` + --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:18:1 | -20 | struct Dst(AU16); +18 | struct Dst(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `FromBytes`: () (A, B) (A, B, C) @@ -24,8 +24,8 @@ help: the trait `zerocopy::FromBytes` is not implemented for `Dst` (A, B, C, D, E, F, G, H) and $N others note: required by a bound in `AssertDstIsFromBytes` - --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:23:34 + --> tests/ui-stable/transmute-ref-dst-not-frombytes.rs:21:34 | -23 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_FROM_BYTES: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertDstIsFromBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/transmute-ref-dst-not-nocell.stderr b/tests/ui-stable/transmute-ref-dst-not-nocell.stderr index 7be53d86ba..b0e20e0ed1 100644 --- a/tests/ui-stable/transmute-ref-dst-not-nocell.stderr +++ b/tests/ui-stable/transmute-ref-dst-not-nocell.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Dst: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:23:33 +error[E0277]: the trait bound `Dst: Immutable` is not satisfied + --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::Immutable` is not implemented for `Dst` - --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Dst` + --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:18:1 | -20 | struct Dst(AU16); +18 | struct Dst(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Dst` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -24,8 +24,8 @@ help: the trait `zerocopy::Immutable` is not implemented for `Dst` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertDstIsImmutable` - --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:23:33 + --> tests/ui-stable/transmute-ref-dst-not-nocell.rs:21:33 | -23 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); +21 | const DST_NOT_IMMUTABLE: &Dst = transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertDstIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/transmute-ref-dst-unsized.stderr b/tests/ui-stable/transmute-ref-dst-unsized.stderr index 2da70424bb..a8933fb9a4 100644 --- a/tests/ui-stable/transmute-ref-dst-unsized.stderr +++ b/tests/ui-stable/transmute-ref-dst-unsized.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-stable/transmute-ref-dst-unsized.rs:17:28 + --> tests/ui-stable/transmute-ref-dst-unsized.rs:15:28 | - 17 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); + 15 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` diff --git a/tests/ui-stable/transmute-ref-src-dst-not-references.stderr b/tests/ui-stable/transmute-ref-src-dst-not-references.stderr index 8a80e991e6..74d0fbd1a9 100644 --- a/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +++ b/tests/ui-stable/transmute-ref-src-dst-not-references.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:54 + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:15:54 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected `&_`, found `usize` @@ -11,13 +11,13 @@ error[E0308]: mismatched types found type `usize` help: consider borrowing here | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(&0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(&0usize); | + error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -25,9 +25,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` @@ -35,9 +35,9 @@ error[E0308]: mismatched types = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39 + --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:15:39 | -17 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); +15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_` | = note: expected type `usize` diff --git a/tests/ui-stable/transmute-ref-src-not-a-reference.stderr b/tests/ui-stable/transmute-ref-src-not-a-reference.stderr index 622c3db9ac..3f86d39231 100644 --- a/tests/ui-stable/transmute-ref-src-not-a-reference.stderr +++ b/tests/ui-stable/transmute-ref-src-not-a-reference.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:49 + --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:15:49 | -17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); +15 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize); | ---------------^^^^^^- | | | | | expected `&_`, found `usize` @@ -11,5 +11,5 @@ error[E0308]: mismatched types found type `usize` help: consider borrowing here | -17 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize); +15 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize); | + diff --git a/tests/ui-stable/transmute-ref-src-not-intobytes.stderr b/tests/ui-stable/transmute-ref-src-not-intobytes.stderr index 11556f74a2..5eb5496a38 100644 --- a/tests/ui-stable/transmute-ref-src-not-intobytes.stderr +++ b/tests/ui-stable/transmute-ref-src-not-intobytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `Src` - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:20:1 +help: the trait `IntoBytes` is not implemented for `Src` + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -24,25 +24,25 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `Src` AtomicIsize and $N others note: required by a bound in `AssertSrcIsIntoBytes` - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsIntoBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:23:33 +error[E0277]: the trait bound `Src: IntoBytes` is not satisfied + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `Src` - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:20:1 +help: the trait `IntoBytes` is not implemented for `Src` + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -53,8 +53,8 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `Src` AtomicIsize and $N others note: required by a bound in `AssertSrcIsIntoBytes` - --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:23:33 + --> tests/ui-stable/transmute-ref-src-not-intobytes.rs:21:33 | -23 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_AS_BYTES: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsIntoBytes` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/transmute-ref-src-not-nocell.stderr b/tests/ui-stable/transmute-ref-src-not-nocell.stderr index 19bbaf8f99..ca32a513c4 100644 --- a/tests/ui-stable/transmute-ref-src-not-nocell.stderr +++ b/tests/ui-stable/transmute-ref-src-not-nocell.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::Immutable` is not implemented for `Src` - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Src` + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Src` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -24,25 +24,25 @@ help: the trait `zerocopy::Immutable` is not implemented for `Src` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertSrcIsImmutable` - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `Src: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:23:34 +error[E0277]: the trait bound `Src: Immutable` is not satisfied + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `Src` - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:20:1 +help: the trait `Immutable` is not implemented for `Src` + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:18:1 | -20 | struct Src(AU16); +18 | struct Src(AU16); | ^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `Src` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -53,8 +53,8 @@ help: the trait `zerocopy::Immutable` is not implemented for `Src` (A, B, C, D, E, F) and $N others note: required by a bound in `AssertSrcIsImmutable` - --> tests/ui-stable/transmute-ref-src-not-nocell.rs:23:34 + --> tests/ui-stable/transmute-ref-src-not-nocell.rs:21:34 | -23 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); +21 | const SRC_NOT_IMMUTABLE: &AU16 = transmute_ref!(&Src(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AssertSrcIsImmutable` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui-stable/transmute-ref-src-unsized.stderr b/tests/ui-stable/transmute-ref-src-unsized.stderr index 30937fda28..c7cb4be571 100644 --- a/tests/ui-stable/transmute-ref-src-unsized.stderr +++ b/tests/ui-stable/transmute-ref-src-unsized.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize` - --> tests/ui-stable/transmute-ref-src-unsized.rs:16:31 + --> tests/ui-stable/transmute-ref-src-unsized.rs:14:31 | -16 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); +14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()` | = note: required for `Wrap<&[u8], &[u8; 1]>` to implement `TransmuteRefDst<'_>` diff --git a/tests/ui-stable/transmute-size-decrease.stderr b/tests/ui-stable/transmute-size-decrease.stderr index 2852cb339e..da96da33ce 100644 --- a/tests/ui-stable/transmute-size-decrease.stderr +++ b/tests/ui-stable/transmute-size-decrease.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 2-byte type to 1-byte type: `AU16` -> `u8` - --> tests/ui-stable/transmute-size-decrease.rs:20:27 + --> tests/ui-stable/transmute-size-decrease.rs:18:27 | -20 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); +18 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ evaluation of `DECREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/transmute-size-decrease.rs:20:27 + --> tests/ui-stable/transmute-size-decrease.rs:18:27 | -20 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); +18 | const DECREASE_SIZE: u8 = transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-stable/transmute-size-increase-allow-shrink.stderr b/tests/ui-stable/transmute-size-increase-allow-shrink.stderr index 9050a73bfa..6e765eb822 100644 --- a/tests/ui-stable/transmute-size-increase-allow-shrink.stderr +++ b/tests/ui-stable/transmute-size-increase-allow-shrink.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 1-byte type to 2-byte type: `u8` -> `Transmute` - --> tests/ui-stable/transmute-size-increase-allow-shrink.rs:20:29 + --> tests/ui-stable/transmute-size-increase-allow-shrink.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INCREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/transmute-size-increase-allow-shrink.rs:20:29 + --> tests/ui-stable/transmute-size-increase-allow-shrink.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(#![allow(shrink)] 0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-stable/transmute-size-increase.stderr b/tests/ui-stable/transmute-size-increase.stderr index 40be466fce..e2bb71f059 100644 --- a/tests/ui-stable/transmute-size-increase.stderr +++ b/tests/ui-stable/transmute-size-increase.stderr @@ -1,15 +1,15 @@ error[E0080]: transmuting from 1-byte type to 2-byte type: `u8` -> `AU16` - --> tests/ui-stable/transmute-size-increase.rs:20:29 + --> tests/ui-stable/transmute-size-increase.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(0u8); | ^^^^^^^^^^^^^^^ evaluation of `INCREASE_SIZE` failed here | = note: this error originates in the macro `transmute` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/transmute-size-increase.rs:20:29 + --> tests/ui-stable/transmute-size-increase.rs:18:29 | -20 | const INCREASE_SIZE: AU16 = transmute!(0u8); +18 | const INCREASE_SIZE: AU16 = transmute!(0u8); | ^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-stable/transmute-src-not-intobytes.stderr b/tests/ui-stable/transmute-src-not-intobytes.stderr index a3cfa3942d..5771406132 100644 --- a/tests/ui-stable/transmute-src-not-intobytes.stderr +++ b/tests/ui-stable/transmute-src-not-intobytes.stderr @@ -1,19 +1,19 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/transmute-src-not-intobytes.rs:19:32 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | unsatisfied trait bound | required by a bound introduced by this call | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -24,9 +24,9 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicIsize and $N others note: required by a bound in `SRC_NOT_AS_BYTES::transmute` - --> tests/ui-stable/transmute-src-not-intobytes.rs:19:32 + --> tests/ui-stable/transmute-src-not-intobytes.rs:17:32 | -19 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); +17 | const SRC_NOT_AS_BYTES: AU16 = transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | required by a bound in this function diff --git a/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr b/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr index d40f55f685..bf18912c71 100644 --- a/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr +++ b/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:17:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:15:33 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:15:58 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute` | ^^^^^^^^^^^^ required by this bound in `try_transmute` = note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:17:58 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs:15:58 | - 17 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); + 15 | let dst_not_try_from_bytes: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-stable/try_transmute-size-decrease.stderr b/tests/ui-stable/try_transmute-size-decrease.stderr index d52462d51c..03ccf50ec0 100644 --- a/tests/ui-stable/try_transmute-size-decrease.stderr +++ b/tests/ui-stable/try_transmute-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute-size-decrease.rs:19:41 + --> tests/ui-stable/try_transmute-size-decrease.rs:17:41 | -19 | let _decrease_size: Result = try_transmute!(AU16(0)); +17 | let _decrease_size: Result = try_transmute!(AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-stable/try_transmute-size-increase.stderr b/tests/ui-stable/try_transmute-size-increase.stderr index 076dc26b47..90cd927ff9 100644 --- a/tests/ui-stable/try_transmute-size-increase.stderr +++ b/tests/ui-stable/try_transmute-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute-size-increase.rs:19:43 + --> tests/ui-stable/try_transmute-size-increase.rs:17:43 | -19 | let _increase_size: Result = try_transmute!(0u8); +17 | let _increase_size: Result = try_transmute!(0u8); | ^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-stable/try_transmute-src-not-intobytes.stderr b/tests/ui-stable/try_transmute-src-not-intobytes.stderr index 5d6a48a1f3..2af9510ed9 100644 --- a/tests/ui-stable/try_transmute-src-not-intobytes.stderr +++ b/tests/ui-stable/try_transmute-src-not-intobytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute-src-not-intobytes.rs:18:47 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/try_transmute-src-not-intobytes.rs:16:47 | - 18 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); + 16 | let src_not_into_bytes: Result = try_transmute!(NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool diff --git a/tests/ui-stable/try_transmute_mut-alignment-increase.stderr b/tests/ui-stable/try_transmute_mut-alignment-increase.stderr index 800bfae2b6..de18757c32 100644 --- a/tests/ui-stable/try_transmute_mut-alignment-increase.stderr +++ b/tests/ui-stable/try_transmute_mut-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_mut-alignment-increase.rs:20:48 + --> tests/ui-stable/try_transmute_mut-alignment-increase.rs:18:48 | -20 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut AU16, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr b/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr index 7b342747f7..3bd6a75451 100644 --- a/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +++ b/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:20:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:18:33 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -90,19 +90,19 @@ note: required by a bound in `try_transmute_mut` | ^^^^^^^^^ required by this bound in `try_transmute_mut` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:20:63 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs:18:63 | - 20 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); + 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-stable/try_transmute_mut-size-decrease.stderr b/tests/ui-stable/try_transmute_mut-size-decrease.stderr index 8876faefec..b22f73e65f 100644 --- a/tests/ui-stable/try_transmute_mut-size-decrease.stderr +++ b/tests/ui-stable/try_transmute_mut-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_mut-size-decrease.rs:20:46 + --> tests/ui-stable/try_transmute_mut-size-decrease.rs:18:46 | -20 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); +18 | let _decrease_size: Result<&mut u8, _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-stable/try_transmute_mut-size-increase.stderr b/tests/ui-stable/try_transmute_mut-size-increase.stderr index 8be07db424..0c409d86f2 100644 --- a/tests/ui-stable/try_transmute_mut-size-increase.stderr +++ b/tests/ui-stable/try_transmute_mut-size-increase.stderr @@ -1,15 +1,15 @@ warning: unused import: `util::AU16` - --> tests/ui-stable/try_transmute_mut-size-increase.rs:13:5 + --> tests/ui-stable/try_transmute_mut-size-increase.rs:11:5 | -13 | use util::AU16; +11 | use util::AU16; | ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_mut-size-increase.rs:20:51 + --> tests/ui-stable/try_transmute_mut-size-increase.rs:18:51 | -20 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); +18 | let _increase_size: Result<&mut [u8; 2], _> = try_transmute_mut!(src); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u8` (8 bits) diff --git a/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr b/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr index 2c8a1a4bae..fd5624dada 100644 --- a/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr +++ b/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Src` - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:15:1 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:13:1 | - 15 | struct Src; + 13 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Src` = help: the following other types implement trait `FromBytes`: @@ -31,15 +31,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:19:1 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: @@ -63,15 +63,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:19:1 + --> tests/ui-stable/try_transmute_mut-src-not-frombytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr b/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr index 0aae9b99c1..88deb96c9b 100644 --- a/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr +++ b/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `Src: IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Src` - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:15:1 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:13:1 | - 15 | struct Src; + 13 | struct Src; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Src` = help: the following other types implement trait `IntoBytes`: @@ -31,15 +31,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: FromBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromBytes` is not implemented for `Dst` - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:19:1 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `Dst` = help: the following other types implement trait `FromBytes`: @@ -63,15 +63,15 @@ note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut` = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Dst: IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:23:40 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:21:40 | - 23 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); + 21 | let src_not_from_bytes: &mut Dst = transmute_mut!(&mut Src); | ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `IntoBytes` is not implemented for `Dst` - --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:19:1 + --> tests/ui-stable/try_transmute_mut-src-not-intobytes.rs:17:1 | - 19 | struct Dst; + 17 | struct Dst; | ^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `Dst` = help: the following other types implement trait `IntoBytes`: diff --git a/tests/ui-stable/try_transmute_ref-alignment-increase.stderr b/tests/ui-stable/try_transmute_ref-alignment-increase.stderr index d009ee7625..4017d9d7a2 100644 --- a/tests/ui-stable/try_transmute_ref-alignment-increase.stderr +++ b/tests/ui-stable/try_transmute_ref-alignment-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_ref-alignment-increase.rs:19:44 + --> tests/ui-stable/try_transmute_ref-alignment-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-stable/try_transmute_ref-dst-mutable.stderr b/tests/ui-stable/try_transmute_ref-dst-mutable.stderr index 2caaf36e1a..deb4b45845 100644 --- a/tests/ui-stable/try_transmute_ref-dst-mutable.stderr +++ b/tests/ui-stable/try_transmute_ref-dst-mutable.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:16:33 | - 18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); + 16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ | | | types differ in mutability @@ -10,9 +10,9 @@ error[E0308]: mismatched types = note: expected mutable reference `&mut u8` found reference `&_` help: the type constructed contains `&_` due to the type of the argument passed - --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:16:33 | - 18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); + 16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ this argument influences the type of `Ok` note: tuple variant defined here --> $RUST/core/src/result.rs @@ -22,9 +22,9 @@ note: tuple variant defined here = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:18:33 + --> tests/ui-stable/try_transmute_ref-dst-mutable.rs:16:33 | -18 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); +16 | let _: Result<&mut u8, _> = try_transmute_ref!(&0u8); | ^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected enum `Result<&mut u8, _>` diff --git a/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr b/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr index 2dd0641184..4457e334df 100644 --- a/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +++ b/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:33 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:33 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -26,19 +26,19 @@ note: required by a bound in `ValidityError` | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) @@ -58,19 +58,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () @@ -90,19 +90,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:19:59 +error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied + --> tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59 | - 19 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); + 17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `TryFromBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `TryFromBytes`: () (A, B) (A, B, C) diff --git a/tests/ui-stable/try_transmute_ref-size-decrease.stderr b/tests/ui-stable/try_transmute_ref-size-decrease.stderr index ae3f68d31e..cad4916464 100644 --- a/tests/ui-stable/try_transmute_ref-size-decrease.stderr +++ b/tests/ui-stable/try_transmute_ref-size-decrease.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_ref-size-decrease.rs:19:42 + --> tests/ui-stable/try_transmute_ref-size-decrease.rs:17:42 | -19 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); +17 | let _decrease_size: Result<&u8, _> = try_transmute_ref!(&AU16(0)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AU16` (16 bits) diff --git a/tests/ui-stable/try_transmute_ref-size-increase.stderr b/tests/ui-stable/try_transmute_ref-size-increase.stderr index 8d71ab3621..625c8ac74f 100644 --- a/tests/ui-stable/try_transmute_ref-size-increase.stderr +++ b/tests/ui-stable/try_transmute_ref-size-increase.stderr @@ -1,7 +1,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> tests/ui-stable/try_transmute_ref-size-increase.rs:19:44 + --> tests/ui-stable/try_transmute_ref-size-increase.rs:17:44 | -19 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); +17 | let _increase_size: Result<&AU16, _> = try_transmute_ref!(&[0u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `AlignOf<[u8; 2]>` (8 bits) diff --git a/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr b/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr index 831b088d75..920bdf4225 100644 --- a/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +++ b/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied + --> tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | - 19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + 17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `IntoBytes` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `IntoBytes`: () AU16 AtomicBool @@ -30,19 +30,19 @@ note: required by a bound in `try_transmute_ref` | ^^^^^^^^^ required by this bound in `try_transmute_ref` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs:19:48 +error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied + --> tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs:17:48 | - 19 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); + 17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Immutable` is not implemented for `NotZerocopy` - --> tests/ui-stable/../../zerocopy-derive/tests/include.rs +help: the trait `Immutable` is not implemented for `NotZerocopy` + --> tests/ui-stable/../include.rs | - 48 | pub struct NotZerocopy(pub T); + 15 | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `Immutable`: &T &mut T () diff --git a/zerocopy-derive/Cargo.toml b/zerocopy-derive/Cargo.toml index a6e77b8686..b274da2f4c 100644 --- a/zerocopy-derive/Cargo.toml +++ b/zerocopy-derive/Cargo.toml @@ -55,4 +55,8 @@ testutil = { path = "../testutil" } # sometimes change the output format slightly, so a version mismatch can cause # CI test failures. trybuild = { version = "=1.0.89", features = ["diff"] } -zerocopy = { path = "../", features = ["derive"] } +# We import as `zerocopy-renamed` so that we can refer to the crate as +# `zerocopy-renamed` in the generated code, which allows us to test that the +# `crate` attribute works correctly, and ensures that we never accidentally +# hard-code the name `zerocopy` in the generated code. +zerocopy-renamed = { package = "zerocopy", path = "../", features = ["derive"] } diff --git a/zerocopy-derive/src/enum.rs b/zerocopy-derive/src/enum.rs index d8dbc47b70..19e3a2e08d 100644 --- a/zerocopy-derive/src/enum.rs +++ b/zerocopy-derive/src/enum.rs @@ -21,7 +21,8 @@ use crate::{ /// Generates a tag enum for the given enum. This generates an enum with the /// same non-align `repr`s, variants, and corresponding discriminants, but none /// of the fields. -pub(crate) fn generate_tag_enum(repr: &EnumRepr, data: &DataEnum) -> TokenStream { +pub(crate) fn generate_tag_enum(ctx: &Ctx, repr: &EnumRepr, data: &DataEnum) -> TokenStream { + let zerocopy_crate = &ctx.zerocopy_crate; let variants = data.variants.iter().map(|v| { let ident = &v.ident; if let Some((eq, discriminant)) = &v.discriminant { @@ -48,7 +49,7 @@ pub(crate) fn generate_tag_enum(repr: &EnumRepr, data: &DataEnum) -> TokenStream // SAFETY: `___ZerocopyTag` has no fields, and so it does not permit // interior mutation. - unsafe impl ::zerocopy::Immutable for ___ZerocopyTag { + unsafe impl #zerocopy_crate::Immutable for ___ZerocopyTag { fn only_derive_is_allowed_to_implement_this_trait() {} } } @@ -240,7 +241,7 @@ pub(crate) fn derive_is_bit_valid( repr: &EnumRepr, ) -> Result { let trait_path = Trait::TryFromBytes.crate_path(&ctx.zerocopy_crate); - let tag_enum = generate_tag_enum(repr, data); + let tag_enum = generate_tag_enum(ctx, repr, data); let tag_consts = generate_tag_consts(data); let (outer_tag_type, inner_tag_type) = if repr.is_c() { diff --git a/zerocopy-derive/src/lib.rs b/zerocopy-derive/src/lib.rs index 7cc1d7a2f8..ebd38ad45e 100644 --- a/zerocopy-derive/src/lib.rs +++ b/zerocopy-derive/src/lib.rs @@ -651,13 +651,14 @@ fn derive_split_at_inner(ctx: &Ctx, _top_level: Trait) -> Result::Elem; + type Elem = <#trailing_field as #zerocopy_crate::SplitAt>::Elem; }) .build()) } @@ -1219,7 +1220,7 @@ fn derive_into_bytes_enum(ctx: &Ctx, enm: &DataEnum) -> Result() { + path = parse_quote!(::#path_lit); return Ok(()); } } diff --git a/zerocopy-derive/tests/crate_path.rs b/zerocopy-derive/tests/crate_path.rs deleted file mode 100644 index ea1f4662aa..0000000000 --- a/zerocopy-derive/tests/crate_path.rs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2024 The Fuchsia Authors -// -// Licensed under a BSD-style license , Apache License, Version 2.0 -// , or the MIT -// license , at your option. -// This file may not be copied, modified, or distributed except according to -// those terms. - -// Make sure that the derive macros will respect the -// `#[zerocopy(crate = "...")]` attribute when renaming the crate. - -// See comment in `include.rs` for why we disable the prelude. -#![no_implicit_prelude] -#![allow(warnings)] - -include!("include.rs"); - -#[test] -fn test_gen_custom_zerocopy() { - #[derive( - imp::ByteEq, - imp::ByteHash, - imp::IntoBytes, - imp::FromBytes, - imp::Unaligned, - imp::Immutable, - imp::KnownLayout, - )] - #[zerocopy(crate = "fake_zerocopy")] - #[repr(packed)] - struct SomeStruct { - a: u16, - b: u32, - } - - impl AssertNotZerocopyIntoBytes for SomeStruct {} - impl AssertNotZerocopyFromBytes for SomeStruct {} - impl AssertNotZerocopyUnaligned for SomeStruct {} - impl AssertNotZerocopyImmutable for SomeStruct {} - impl AssertNotZerocopyKnownLayout for SomeStruct {} - - fake_zerocopy::assert::(); -} - -mod fake_zerocopy { - use ::std::{io, ptr::NonNull, unimplemented}; - - pub use super::imp::*; - - pub fn assert() - where - T: IntoBytes + FromBytes + Unaligned + Immutable, - { - } - - pub unsafe trait IntoBytes { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized; - - fn as_bytes(&self) -> &[u8] - where - Self: Immutable, - { - unimplemented!() - } - } - - pub unsafe trait FromBytes: FromZeros { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized; - } - - pub unsafe trait Unaligned { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized; - } - - pub unsafe trait Immutable { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized; - } - - pub unsafe trait KnownLayout { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized; - - type PointerMetadata: PointerMetadata; - - type MaybeUninit: ?Sized + KnownLayout; - - const LAYOUT: DstLayout; - - fn raw_from_ptr_len(bytes: NonNull, meta: Self::PointerMetadata) -> NonNull; - - fn pointer_to_metadata(ptr: *mut Self) -> Self::PointerMetadata; - } - - macro_rules! impl_ty { - ($ty:ty $(as $generic:ident)?) => { - unsafe impl$(<$generic: IntoBytes>)? IntoBytes for $ty { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized, - { - unimplemented!() - } - } - - unsafe impl$(<$generic: FromBytes>)? FromBytes for $ty { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized, - { - unimplemented!() - } - } - - unsafe impl$(<$generic: Unaligned>)? Unaligned for $ty { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized, - { - unimplemented!() - } - } - - unsafe impl$(<$generic: Immutable>)? Immutable for $ty { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized, - { - unimplemented!() - } - } - - unsafe impl$(<$generic: KnownLayout>)? KnownLayout for $ty { - fn only_derive_is_allowed_to_implement_this_trait() - where - Self: Sized, - { - unimplemented!() - } - - type PointerMetadata = (); - - type MaybeUninit = (); - - const LAYOUT: DstLayout = DstLayout::new_zst(None); - - fn raw_from_ptr_len( - bytes: NonNull, - meta: Self::PointerMetadata, - ) -> NonNull { - unimplemented!() - } - - fn pointer_to_metadata(ptr: *mut Self) -> Self::PointerMetadata { - unimplemented!() - } - } - }; - } - - impl_ty!(()); - impl_ty!(u16); - impl_ty!(u32); - impl_ty!([T] as T); - impl_ty!(::std::mem::MaybeUninit as T); -} - -pub trait AssertNotZerocopyIntoBytes {} -impl AssertNotZerocopyIntoBytes for T {} - -pub trait AssertNotZerocopyFromBytes {} -impl AssertNotZerocopyFromBytes for T {} - -pub trait AssertNotZerocopyUnaligned {} -impl AssertNotZerocopyUnaligned for T {} - -pub trait AssertNotZerocopyImmutable {} -impl AssertNotZerocopyImmutable for T {} - -pub trait AssertNotZerocopyKnownLayout {} -impl AssertNotZerocopyKnownLayout for T {} diff --git a/zerocopy-derive/tests/deprecated.rs b/zerocopy-derive/tests/deprecated.rs index 052e258cde..dcf9a04f2d 100644 --- a/zerocopy-derive/tests/deprecated.rs +++ b/zerocopy-derive/tests/deprecated.rs @@ -26,6 +26,7 @@ macro_rules! test { #[deprecated = "do not use"] #[derive(imp::$trait)] + #[zerocopy(crate = "zerocopy_renamed")] $ty #[allow(deprecated)] @@ -53,6 +54,7 @@ mod enum_hash_eq { use super::super::*; #[deprecated = "do not use"] #[derive(imp::ByteHash, imp::IntoBytes, imp::Immutable)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Enum { A, @@ -67,6 +69,7 @@ mod enum_hash_eq { use super::super::*; #[deprecated = "do not use"] #[derive(imp::ByteEq, imp::IntoBytes, imp::Immutable)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Enum { A, @@ -84,6 +87,7 @@ mod struct_hash_eq { use super::super::*; #[deprecated = "do not use"] #[derive(imp::ByteHash, imp::IntoBytes, imp::Immutable)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct; @@ -96,6 +100,7 @@ mod struct_hash_eq { use super::super::*; #[deprecated = "do not use"] #[derive(imp::ByteEq, imp::IntoBytes, imp::Immutable)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct; @@ -112,6 +117,7 @@ mod split_at_test { use super::super::*; #[deprecated = "do not use"] #[derive(imp::SplitAt, imp::KnownLayout)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct { a: [u8], diff --git a/zerocopy-derive/tests/enum_from_bytes.rs b/zerocopy-derive/tests/enum_from_bytes.rs index 37857e5bdc..6e48bd7c19 100644 --- a/zerocopy-derive/tests/enum_from_bytes.rs +++ b/zerocopy-derive/tests/enum_from_bytes.rs @@ -48,6 +48,7 @@ fn test_trivial_is_bit_valid() { // Make sure no deprecation warning is generated from our derive (see #553). #[deprecated = "do not use"] #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FooU8 { Variant0, @@ -309,6 +310,7 @@ enum FooU8 { } #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FooU8WithData { Variant0(u32), @@ -575,6 +577,7 @@ fn _allow_deprecated() { } #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum FooI8 { Variant0, @@ -838,6 +841,7 @@ enum FooI8 { util_assert_impl_all!(FooI8: imp::FromBytes); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8, align(2))] enum FooU8Align { Variant0, @@ -1101,6 +1105,7 @@ enum FooU8Align { util_assert_impl_all!(FooU8Align: imp::FromBytes); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8, align(2))] enum FooI8Align { Variant0, @@ -1364,6 +1369,7 @@ enum FooI8Align { util_assert_impl_all!(FooI8Align: imp::FromBytes); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u16)] enum FooU16 { Variant0, @@ -66907,6 +66913,7 @@ enum FooU16 { util_assert_impl_all!(FooU16: imp::FromBytes); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i16)] enum FooI16 { Variant0, diff --git a/zerocopy-derive/tests/enum_from_zeros.rs b/zerocopy-derive/tests/enum_from_zeros.rs index 6245785bd7..52dc1a9c0d 100644 --- a/zerocopy-derive/tests/enum_from_zeros.rs +++ b/zerocopy-derive/tests/enum_from_zeros.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum Foo { A, @@ -21,6 +22,7 @@ enum Foo { util_assert_impl_all!(Foo: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum Bar { A = 0, @@ -29,6 +31,7 @@ enum Bar { util_assert_impl_all!(Bar: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum TwoVariantsHasExplicitZero { A = 1, @@ -38,6 +41,7 @@ enum TwoVariantsHasExplicitZero { util_assert_impl_all!(TwoVariantsHasExplicitZero: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum ImplicitNonFirstVariantIsZero { A = -1, @@ -47,6 +51,7 @@ enum ImplicitNonFirstVariantIsZero { util_assert_impl_all!(ImplicitNonFirstVariantIsZero: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u64)] enum LargeDiscriminant { A = 0xFFFF_FFFF_FFFF_FFFF, @@ -56,6 +61,7 @@ enum LargeDiscriminant { util_assert_impl_all!(LargeDiscriminant: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum FirstVariantIsZeroable { A(u32), @@ -65,6 +71,7 @@ enum FirstVariantIsZeroable { util_assert_impl_all!(FirstVariantIsZeroable: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FirstVariantIsZeroableSecondIsNot { A(bool), @@ -79,6 +86,7 @@ mod msrv_only { use super::*; #[derive(imp::FromZeros)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum ImplicitFirstVariantIsZeroable { A(bool), @@ -88,6 +96,7 @@ mod msrv_only { util_assert_impl_all!(ImplicitFirstVariantIsZeroable: imp::FromZeros); #[derive(imp::FromZeros)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum ImplicitNonFirstVariantIsZeroable { A(::core::num::NonZeroU8) = 1, diff --git a/zerocopy-derive/tests/enum_known_layout.rs b/zerocopy-derive/tests/enum_known_layout.rs index 72e52fa67a..77b659b8f4 100644 --- a/zerocopy-derive/tests/enum_known_layout.rs +++ b/zerocopy-derive/tests/enum_known_layout.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] enum Foo { A, } @@ -20,6 +21,7 @@ enum Foo { util_assert_impl_all!(Foo: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] enum Bar { A = 0, } @@ -27,6 +29,7 @@ enum Bar { util_assert_impl_all!(Bar: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] enum Baz { A = 1, B = 0, @@ -37,6 +40,7 @@ util_assert_impl_all!(Baz: imp::KnownLayout); // Deriving `KnownLayout` should work if the enum has bounded parameters. #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::KnownLayout, const N: usize> where diff --git a/zerocopy-derive/tests/enum_no_cell.rs b/zerocopy-derive/tests/enum_no_cell.rs index f22b8da8ce..d543656564 100644 --- a/zerocopy-derive/tests/enum_no_cell.rs +++ b/zerocopy-derive/tests/enum_no_cell.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Foo { A, } @@ -20,6 +21,7 @@ enum Foo { util_assert_impl_all!(Foo: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Bar { A = 0, } @@ -27,6 +29,7 @@ enum Bar { util_assert_impl_all!(Bar: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Baz { A = 1, B = 0, @@ -37,6 +40,7 @@ util_assert_impl_all!(Baz: imp::Immutable); // Deriving `Immutable` should work if the enum has bounded parameters. #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::Immutable, const N: ::core::primitive::usize> where diff --git a/zerocopy-derive/tests/enum_to_bytes.rs b/zerocopy-derive/tests/enum_to_bytes.rs index 560bc8694d..d5bf34a53a 100644 --- a/zerocopy-derive/tests/enum_to_bytes.rs +++ b/zerocopy-derive/tests/enum_to_bytes.rs @@ -15,6 +15,7 @@ include!("include.rs"); // An enum is `IntoBytes` if if has a defined repr. #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum C { A, @@ -23,6 +24,7 @@ enum C { util_assert_impl_all!(C: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum U8 { A, @@ -31,6 +33,7 @@ enum U8 { util_assert_impl_all!(U8: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u16)] enum U16 { A, @@ -39,6 +42,7 @@ enum U16 { util_assert_impl_all!(U16: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum U32 { A, @@ -47,6 +51,7 @@ enum U32 { util_assert_impl_all!(U32: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u64)] enum U64 { A, @@ -55,6 +60,7 @@ enum U64 { util_assert_impl_all!(U64: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(usize)] enum Usize { A, @@ -63,6 +69,7 @@ enum Usize { util_assert_impl_all!(Usize: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum I8 { A, @@ -71,6 +78,7 @@ enum I8 { util_assert_impl_all!(I8: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i16)] enum I16 { A, @@ -79,6 +87,7 @@ enum I16 { util_assert_impl_all!(I16: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i32)] enum I32 { A, @@ -87,6 +96,7 @@ enum I32 { util_assert_impl_all!(I32: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i64)] enum I64 { A, @@ -95,6 +105,7 @@ enum I64 { util_assert_impl_all!(I64: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(isize)] enum Isize { A, @@ -103,6 +114,7 @@ enum Isize { util_assert_impl_all!(Isize: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum HasData { A(u8), @@ -112,6 +124,7 @@ enum HasData { util_assert_impl_all!(HasData: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum HasData32 { A(u32), @@ -127,6 +140,7 @@ util_assert_impl_all!(HasData: imp::IntoBytes); // Tag { A }`, which is two bytes long, rather than the correct `#[repr(u8)] // struct Tag { A }`, which is one byte long. #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8, align(2))] enum BadTagWouldHavePadding { A(u8, u16), diff --git a/zerocopy-derive/tests/enum_try_from_bytes.rs b/zerocopy-derive/tests/enum_try_from_bytes.rs index bd89803eca..f98022ff61 100644 --- a/zerocopy-derive/tests/enum_try_from_bytes.rs +++ b/zerocopy-derive/tests/enum_try_from_bytes.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(Eq, PartialEq, Debug, imp::Immutable, imp::KnownLayout, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Foo { A, @@ -29,6 +30,7 @@ fn test_foo() { } #[derive(Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u16)] enum Bar { A = 0, @@ -46,6 +48,7 @@ fn test_bar() { } #[derive(Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum Baz { A = 1, @@ -78,6 +81,7 @@ type i8 = bool; const THREE: ::core::primitive::i8 = 3; #[derive(Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum Blah { A = 1, @@ -114,6 +118,7 @@ fn test_blah() { #[derive( Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes, imp::IntoBytes, )] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum FieldlessButNotUnitOnly { A, @@ -124,17 +129,17 @@ enum FieldlessButNotUnitOnly { #[test] fn test_fieldless_but_not_unit_only() { const SIZE: usize = ::core::mem::size_of::(); - let disc: [u8; SIZE] = ::zerocopy::transmute!(FieldlessButNotUnitOnly::A); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(FieldlessButNotUnitOnly::A); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(FieldlessButNotUnitOnly::A) ); - let disc: [u8; SIZE] = ::zerocopy::transmute!(FieldlessButNotUnitOnly::B()); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(FieldlessButNotUnitOnly::B()); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(FieldlessButNotUnitOnly::B()) ); - let disc: [u8; SIZE] = ::zerocopy::transmute!(FieldlessButNotUnitOnly::C {}); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(FieldlessButNotUnitOnly::C {}); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(FieldlessButNotUnitOnly::C {}) @@ -148,6 +153,7 @@ fn test_fieldless_but_not_unit_only() { #[derive( Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes, imp::IntoBytes, )] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum WeirdDiscriminants { A = -7, @@ -158,17 +164,17 @@ enum WeirdDiscriminants { #[test] fn test_weird_discriminants() { const SIZE: usize = ::core::mem::size_of::(); - let disc: [u8; SIZE] = ::zerocopy::transmute!(WeirdDiscriminants::A); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(WeirdDiscriminants::A); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(WeirdDiscriminants::A) ); - let disc: [u8; SIZE] = ::zerocopy::transmute!(WeirdDiscriminants::B); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(WeirdDiscriminants::B); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(WeirdDiscriminants::B) ); - let disc: [u8; SIZE] = ::zerocopy::transmute!(WeirdDiscriminants::C); + let disc: [u8; SIZE] = ::zerocopy_renamed::transmute!(WeirdDiscriminants::C); imp::assert_eq!( ::try_read_from_bytes(&disc[..]), imp::Ok(WeirdDiscriminants::C) @@ -183,6 +189,7 @@ fn test_weird_discriminants() { #[derive( Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes, imp::IntoBytes, )] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum HasFields { A(u32), @@ -193,14 +200,15 @@ enum HasFields { fn test_has_fields() { const SIZE: usize = ::core::mem::size_of::(); - let bytes: [u8; SIZE] = ::zerocopy::transmute!(HasFields::A(10)); + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(HasFields::A(10)); imp::assert_eq!( ::try_read_from_bytes(&bytes[..]), imp::Ok(HasFields::A(10)), ); - let bytes: [u8; SIZE] = - ::zerocopy::transmute!(HasFields::B { foo: ::core::num::NonZeroU32::new(123456).unwrap() }); + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(HasFields::B { + foo: ::core::num::NonZeroU32::new(123456).unwrap() + }); imp::assert_eq!( ::try_read_from_bytes(&bytes[..]), imp::Ok(HasFields::B { foo: ::core::num::NonZeroU32::new(123456).unwrap() }), @@ -208,6 +216,7 @@ fn test_has_fields() { } #[derive(Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(16))] enum HasFieldsAligned { A(u32), @@ -221,6 +230,7 @@ fn test_has_fields_aligned() { const SIZE: usize = ::core::mem::size_of::(); #[derive(imp::IntoBytes)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct BytesOfHasFieldsAligned { has_fields: HasFields, @@ -229,13 +239,13 @@ fn test_has_fields_aligned() { let wrap = |has_fields| BytesOfHasFieldsAligned { has_fields, padding: [0; 8] }; - let bytes: [u8; SIZE] = ::zerocopy::transmute!(wrap(HasFields::A(10))); + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(wrap(HasFields::A(10))); imp::assert_eq!( ::try_read_from_bytes(&bytes[..]), imp::Ok(HasFieldsAligned::A(10)), ); - let bytes: [u8; SIZE] = ::zerocopy::transmute!(wrap(HasFields::B { + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(wrap(HasFields::B { foo: ::core::num::NonZeroU32::new(123456).unwrap() })); imp::assert_eq!( @@ -247,6 +257,7 @@ fn test_has_fields_aligned() { #[derive( Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes, imp::IntoBytes, )] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum HasFieldsPrimitive { A(u32), @@ -257,13 +268,13 @@ enum HasFieldsPrimitive { fn test_has_fields_primitive() { const SIZE: usize = ::core::mem::size_of::(); - let bytes: [u8; SIZE] = ::zerocopy::transmute!(HasFieldsPrimitive::A(10)); + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(HasFieldsPrimitive::A(10)); imp::assert_eq!( ::try_read_from_bytes(&bytes[..]), imp::Ok(HasFieldsPrimitive::A(10)), ); - let bytes: [u8; SIZE] = ::zerocopy::transmute!(HasFieldsPrimitive::B { + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(HasFieldsPrimitive::B { foo: ::core::num::NonZeroU32::new(123456).unwrap(), }); imp::assert_eq!( @@ -273,6 +284,7 @@ fn test_has_fields_primitive() { } #[derive(Eq, PartialEq, Debug, imp::KnownLayout, imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32, align(16))] enum HasFieldsPrimitiveAligned { A(u32), @@ -286,6 +298,7 @@ fn test_has_fields_primitive_aligned() { const SIZE: usize = ::core::mem::size_of::(); #[derive(imp::IntoBytes)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct BytesOfHasFieldsPrimitiveAligned { has_fields: HasFieldsPrimitive, @@ -294,13 +307,13 @@ fn test_has_fields_primitive_aligned() { let wrap = |has_fields| BytesOfHasFieldsPrimitiveAligned { has_fields, padding: [0; 8] }; - let bytes: [u8; SIZE] = ::zerocopy::transmute!(wrap(HasFieldsPrimitive::A(10))); + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(wrap(HasFieldsPrimitive::A(10))); imp::assert_eq!( ::try_read_from_bytes(&bytes[..]), imp::Ok(HasFieldsPrimitiveAligned::A(10)), ); - let bytes: [u8; SIZE] = ::zerocopy::transmute!(wrap(HasFieldsPrimitive::B { + let bytes: [u8; SIZE] = ::zerocopy_renamed::transmute!(wrap(HasFieldsPrimitive::B { foo: ::core::num::NonZeroU32::new(123456).unwrap() })); imp::assert_eq!( @@ -312,6 +325,7 @@ fn test_has_fields_primitive_aligned() { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(4), u32)] enum HasReprAlignFirst { A, @@ -321,6 +335,7 @@ enum HasReprAlignFirst { util_assert_impl_all!(HasReprAlignFirst: imp::TryFromBytes); #[derive(imp::KnownLayout, imp::TryFromBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Complex { UnitLike, @@ -331,6 +346,7 @@ enum Complex { util_assert_impl_all!(Complex: imp::TryFromBytes); #[derive(imp::KnownLayout, imp::TryFromBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum ComplexWithGenerics { UnitLike, @@ -341,6 +357,7 @@ enum ComplexWithGenerics { util_assert_impl_all!(ComplexWithGenerics: imp::TryFromBytes); #[derive(imp::KnownLayout, imp::TryFromBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum GenericWithLifetimes<'a, 'b, X: 'a, Y: 'b> { Foo(::core::marker::PhantomData<&'a X>), @@ -348,9 +365,11 @@ enum GenericWithLifetimes<'a, 'b, X: 'a, Y: 'b> { } #[derive(Clone, Copy, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct A; #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum B { A(A), @@ -358,6 +377,7 @@ enum B { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FooU8 { Variant0, @@ -636,6 +656,7 @@ mod issue_2051 { // Prevents regressions of #2051. #[repr(u32)] #[derive(imp::TryFromBytes)] + #[zerocopy(crate = "zerocopy_renamed")] #[allow(non_camel_case_types)] pub enum Code { I32_ADD, @@ -645,6 +666,7 @@ mod issue_2051 { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum RawIdentifierVariant { r#type, diff --git a/zerocopy-derive/tests/enum_unaligned.rs b/zerocopy-derive/tests/enum_unaligned.rs index 2d8f510f98..a0d568daad 100644 --- a/zerocopy-derive/tests/enum_unaligned.rs +++ b/zerocopy-derive/tests/enum_unaligned.rs @@ -17,6 +17,7 @@ include!("include.rs"); // - `repr(u8)` or `repr(i8)` #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Foo { A, @@ -25,6 +26,7 @@ enum Foo { util_assert_impl_all!(Foo: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum Bar { A, @@ -33,6 +35,7 @@ enum Bar { util_assert_impl_all!(Bar: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8, align(1))] enum Baz { A, @@ -41,6 +44,7 @@ enum Baz { util_assert_impl_all!(Baz: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8, align(1))] enum Blah { B, diff --git a/zerocopy-derive/tests/eq.rs b/zerocopy-derive/tests/eq.rs index 084f2c2261..628d6a5515 100644 --- a/zerocopy-derive/tests/eq.rs +++ b/zerocopy-derive/tests/eq.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(imp::Debug, imp::IntoBytes, imp::Immutable, imp::ByteEq)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct { a: u64, diff --git a/zerocopy-derive/tests/hash.rs b/zerocopy-derive/tests/hash.rs index 08b172f49b..4cc32f4824 100644 --- a/zerocopy-derive/tests/hash.rs +++ b/zerocopy-derive/tests/hash.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(imp::IntoBytes, imp::Immutable, imp::ByteHash)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct { a: u64, diff --git a/zerocopy-derive/tests/hygiene.rs b/zerocopy-derive/tests/hygiene.rs index 2477e9fecd..9451592359 100644 --- a/zerocopy-derive/tests/hygiene.rs +++ b/zerocopy-derive/tests/hygiene.rs @@ -16,9 +16,10 @@ include!("include.rs"); -extern crate zerocopy as _zerocopy; +extern crate zerocopy_renamed as _zerocopy; #[derive(_zerocopy::KnownLayout, _zerocopy::FromBytes, _zerocopy::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct TypeParams<'a, T, I: imp::Iterator> { a: T, @@ -49,6 +50,7 @@ mod issue_2177 { macro_rules! define { ($name:ident, $repr:ty) => { #[derive(_zerocopy::KnownLayout)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub struct $name($repr); }; diff --git a/zerocopy-derive/tests/include.rs b/zerocopy-derive/tests/include.rs index da10b95327..4ad283c279 100644 --- a/zerocopy-derive/tests/include.rs +++ b/zerocopy-derive/tests/include.rs @@ -37,7 +37,7 @@ mod imp { primitive::*, }, ::std::{collections::hash_map::DefaultHasher, prelude::v1::*}, - ::zerocopy::*, + ::zerocopy_renamed::*, }; } @@ -59,6 +59,7 @@ pub mod util { Copy, Clone, )] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(2))] pub struct AU16(pub u16); @@ -121,7 +122,7 @@ pub mod util { // SAFETY: This is intentionally unsound; see the preceding comment. let ptr = unsafe { ptr.assume_initialized() }; - let ptr = ptr.cast::<_, ::zerocopy::pointer::cast::CastSized, _>(); + let ptr = ptr.cast::<_, ::zerocopy_renamed::pointer::cast::CastSized, _>(); assert!(::is_bit_valid(ptr)); } @@ -131,7 +132,7 @@ pub mod util { ) { use super::imp::pointer::{cast::CastSized, BecauseExclusive}; - let candidate = ::zerocopy::Ptr::from_mut(&mut val); + let candidate = ::zerocopy_renamed::Ptr::from_mut(&mut val); let candidate = candidate.forget_aligned(); // SAFETY: by `val: impl IntoBytes`, `val` consists entirely of // initialized bytes. It's still unsound because this might let us diff --git a/zerocopy-derive/tests/issue_2117.rs b/zerocopy-derive/tests/issue_2117.rs index 1ee809ae70..6b177c7b63 100644 --- a/zerocopy-derive/tests/issue_2117.rs +++ b/zerocopy-derive/tests/issue_2117.rs @@ -16,5 +16,6 @@ include!("include.rs"); // Make sure no unexpected `cfg`s are emitted by our derives (see #2117). #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub struct Test(pub [u8; 32]); diff --git a/zerocopy-derive/tests/issue_2835.rs b/zerocopy-derive/tests/issue_2835.rs index f04fec9b74..2557d0ba22 100644 --- a/zerocopy-derive/tests/issue_2835.rs +++ b/zerocopy-derive/tests/issue_2835.rs @@ -6,10 +6,11 @@ // This file may not be copied, modified, or distributed except according to // those terms. -use zerocopy::{IntoBytes, Unalign}; +use zerocopy_renamed::{IntoBytes, Unalign}; #[allow(unused)] #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Struct { leading: Unalign, diff --git a/zerocopy-derive/tests/issue_2880.rs b/zerocopy-derive/tests/issue_2880.rs index f713870f14..7b4a157cf3 100644 --- a/zerocopy-derive/tests/issue_2880.rs +++ b/zerocopy-derive/tests/issue_2880.rs @@ -16,18 +16,21 @@ include!("include.rs"); // idents. #[derive(imp::KnownLayout, imp::IntoBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct TestStruct { a: u8, } #[derive(imp::KnownLayout, imp::IntoBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union TestUnion { a: u8, } #[derive(imp::KnownLayout, imp::FromBytes, imp::IntoBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FooU8 { Variant0, diff --git a/zerocopy-derive/tests/paths_and_modules.rs b/zerocopy-derive/tests/paths_and_modules.rs index 74f28558d6..1a2119547d 100644 --- a/zerocopy-derive/tests/paths_and_modules.rs +++ b/zerocopy-derive/tests/paths_and_modules.rs @@ -18,12 +18,14 @@ mod foo { use super::*; #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub struct Foo { foo: u8, } #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub struct Bar { bar: u8, @@ -33,6 +35,7 @@ mod foo { use foo::Foo; #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Baz { foo: Foo, diff --git a/zerocopy-derive/tests/priv_in_pub.rs b/zerocopy-derive/tests/priv_in_pub.rs index 6e641d0bea..8cc322867c 100644 --- a/zerocopy-derive/tests/priv_in_pub.rs +++ b/zerocopy-derive/tests/priv_in_pub.rs @@ -25,10 +25,12 @@ mod test { // types). #[derive(imp::KnownLayout, imp::IntoBytes, imp::FromZeros, imp::FromBytes, imp::Unaligned)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub struct Public(Private); #[derive(imp::KnownLayout, imp::IntoBytes, imp::FromZeros, imp::FromBytes, imp::Unaligned)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Private(()); } diff --git a/zerocopy-derive/tests/struct_from_bytes.rs b/zerocopy-derive/tests/struct_from_bytes.rs index 8cc816c9e8..3140a0a817 100644 --- a/zerocopy-derive/tests/struct_from_bytes.rs +++ b/zerocopy-derive/tests/struct_from_bytes.rs @@ -16,12 +16,14 @@ include!("include.rs"); // - all fields are `FromBytes` #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct Zst; util_assert_impl_all!(Zst: imp::FromBytes); test_trivial_is_bit_valid!(Zst => test_zst_trivial_is_bit_valid); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct One { a: u8, } @@ -30,6 +32,7 @@ util_assert_impl_all!(One: imp::FromBytes); test_trivial_is_bit_valid!(One => test_one_trivial_is_bit_valid); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct Two { a: u8, b: Zst, @@ -39,6 +42,7 @@ util_assert_impl_all!(Two: imp::FromBytes); test_trivial_is_bit_valid!(Two => test_two_trivial_is_bit_valid); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct Unsized { a: [u8], } @@ -46,6 +50,7 @@ struct Unsized { util_assert_impl_all!(Unsized: imp::FromBytes); #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct TypeParams<'a, T: ?imp::Sized, I: imp::Iterator> { a: I::Item, b: u8, @@ -63,6 +68,7 @@ test_trivial_is_bit_valid!(TypeParams<'static, (), imp::IntoIter<()>> => test_ty // Deriving `FromBytes` should work if the struct has bounded parameters. #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::FromBytes, const N: usize>( [T; N], diff --git a/zerocopy-derive/tests/struct_from_zeros.rs b/zerocopy-derive/tests/struct_from_zeros.rs index 147b04cf1f..1b4ec8d0b4 100644 --- a/zerocopy-derive/tests/struct_from_zeros.rs +++ b/zerocopy-derive/tests/struct_from_zeros.rs @@ -16,11 +16,13 @@ include!("include.rs"); // - all fields are `FromZeros` #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct Zst; util_assert_impl_all!(Zst: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct One { a: bool, } @@ -28,6 +30,7 @@ struct One { util_assert_impl_all!(One: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct Two { a: bool, b: Zst, @@ -36,6 +39,7 @@ struct Two { util_assert_impl_all!(Two: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct Unsized { a: [u8], } @@ -43,6 +47,7 @@ struct Unsized { util_assert_impl_all!(Unsized: imp::FromZeros); #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct TypeParams<'a, T: ?imp::Sized, I: imp::Iterator> { a: I::Item, b: u8, @@ -59,6 +64,7 @@ util_assert_impl_all!(TypeParams<'static, [util::AU16], imp::IntoIter<()>>: imp: // Deriving `FromZeros` should work if the struct has bounded parameters. #[derive(imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::FromZeros, const N: usize>( [T; N], diff --git a/zerocopy-derive/tests/struct_known_layout.rs b/zerocopy-derive/tests/struct_known_layout.rs index 69427d1d97..449c1558fb 100644 --- a/zerocopy-derive/tests/struct_known_layout.rs +++ b/zerocopy-derive/tests/struct_known_layout.rs @@ -15,11 +15,13 @@ extern crate rustversion; include!("include.rs"); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct Zst; util_assert_impl_all!(Zst: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct One { a: bool, } @@ -27,6 +29,7 @@ struct One { util_assert_impl_all!(One: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct Two { a: bool, b: Zst, @@ -35,6 +38,7 @@ struct Two { util_assert_impl_all!(Two: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct TypeParams<'a, T, I: imp::Iterator> { a: I::Item, b: u8, @@ -55,6 +59,7 @@ util_assert_impl_all!(TypeParams<'static, util::AU16, imp::IntoIter<()>>: imp::K #[rustversion::since(1.62)] const _: () = { #[derive(imp::KnownLayout)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::KnownLayout, const N: usize>( [T; N], @@ -73,6 +78,7 @@ const _: () = { // only static lifetimes. This is exercisable on all supported toolchains. #[derive(imp::KnownLayout)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::KnownLayout, const N: usize>( &'a &'b [T; N], @@ -90,6 +96,7 @@ const _: () = { // #2116. #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct WithSelfReference { leading: [u8; Self::N], @@ -106,6 +113,7 @@ util_assert_impl_all!(WithSelfReference: imp::KnownLayout); // #2302. #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct Packet

{ payload: P, @@ -114,6 +122,7 @@ struct Packet

{ util_assert_impl_all!(Packet: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct RawIdentifier { r#type: u8, diff --git a/zerocopy-derive/tests/struct_no_cell.rs b/zerocopy-derive/tests/struct_no_cell.rs index 776996df8f..2b1857cced 100644 --- a/zerocopy-derive/tests/struct_no_cell.rs +++ b/zerocopy-derive/tests/struct_no_cell.rs @@ -13,11 +13,13 @@ include!("include.rs"); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Zst; util_assert_impl_all!(Zst: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct One { a: bool, } @@ -25,6 +27,7 @@ struct One { util_assert_impl_all!(One: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Two { a: bool, b: Zst, @@ -33,6 +36,7 @@ struct Two { util_assert_impl_all!(Two: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Three { a: [u8], } @@ -40,6 +44,7 @@ struct Three { util_assert_impl_all!(Three: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Four<'a> { field: &'a imp::UnsafeCell, } @@ -47,6 +52,7 @@ struct Four<'a> { util_assert_impl_all!(Four<'static>: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct TypeParams<'a, T, U, I: imp::Iterator> { a: I::Item, b: u8, @@ -73,6 +79,7 @@ impl Trait for imp::UnsafeCell { } #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct WithAssocType { field: ::Assoc, } @@ -82,6 +89,7 @@ util_assert_impl_all!(WithAssocType>: imp::Immutable); // Deriving `Immutable` should work if the struct has bounded parameters. #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::Immutable, const N: usize>( [T; N], diff --git a/zerocopy-derive/tests/struct_to_bytes.rs b/zerocopy-derive/tests/struct_to_bytes.rs index 89125d879a..0c78111b37 100644 --- a/zerocopy-derive/tests/struct_to_bytes.rs +++ b/zerocopy-derive/tests/struct_to_bytes.rs @@ -19,12 +19,14 @@ include!("include.rs"); // - `repr(packed)` #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct CZst; util_assert_impl_all!(CZst: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct C { a: u8, @@ -35,6 +37,7 @@ struct C { util_assert_impl_all!(C: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct SyntacticUnsized { a: u8, @@ -45,6 +48,7 @@ struct SyntacticUnsized { util_assert_impl_all!(C: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct Transparent { a: u8, @@ -54,6 +58,7 @@ struct Transparent { util_assert_impl_all!(Transparent: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct TransparentGeneric { a: (), @@ -64,12 +69,14 @@ util_assert_impl_all!(TransparentGeneric: imp::IntoBytes); util_assert_impl_all!(TransparentGeneric<[u64]>: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct CZstPacked; util_assert_impl_all!(CZstPacked: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct CPacked { a: u8, @@ -86,6 +93,7 @@ struct CPacked { util_assert_impl_all!(CPacked: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(2))] // The same caveats as for CPacked apply - we're assuming u64 is at least // 4-byte aligned by default. Without packed(2), this should fail, as there @@ -98,6 +106,7 @@ struct CPacked2 { util_assert_impl_all!(CPacked2: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct CPackedGeneric { t: T, @@ -113,6 +122,7 @@ util_assert_impl_all!(CPackedGeneric: imp::IntoBytes); util_assert_impl_all!(CPackedGeneric: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed)] struct PackedGeneric { t: T, @@ -130,6 +140,7 @@ util_assert_impl_all!(PackedGeneric: imp::IntoBytes); // This test is non-portable, but works so long as Rust happens to lay this // struct out with no padding. #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct Unpacked { a: u8, b: u8, @@ -138,6 +149,7 @@ struct Unpacked { util_assert_impl_all!(Unpacked: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct ReprCGenericOneField { t: T, @@ -149,6 +161,7 @@ util_assert_impl_all!(ReprCGenericOneField: imp::IntoBytes); util_assert_impl_all!(ReprCGenericOneField<[util::AU16]>: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct ReprCGenericMultipleFields { t: T, @@ -163,6 +176,7 @@ util_assert_not_impl_any!(ReprCGenericMultipleFields: imp::IntoB util_assert_not_impl_any!(ReprCGenericMultipleFields: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct Unsized { a: [u8], @@ -173,6 +187,7 @@ util_assert_impl_all!(Unsized: imp::IntoBytes); // Deriving `IntoBytes` should work if the struct has bounded parameters. #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::IntoBytes, const N: usize>( [T; N], @@ -188,10 +203,12 @@ util_assert_impl_all!(WithParams<'static, 'static, u8, 42>: imp::IntoBytes); // Test for the failure reported in #1182. #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] pub struct IndexEntryFlags(u8); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] pub struct IndexEntry { block_number: imp::native_endian::U64, diff --git a/zerocopy-derive/tests/struct_try_from_bytes.rs b/zerocopy-derive/tests/struct_try_from_bytes.rs index fc51de3e2e..7c3288b47e 100644 --- a/zerocopy-derive/tests/struct_try_from_bytes.rs +++ b/zerocopy-derive/tests/struct_try_from_bytes.rs @@ -21,6 +21,7 @@ fn zst() { } #[derive(imp::TryFromBytes, imp::Immutable, imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct One { a: u8, @@ -35,6 +36,7 @@ fn one() { } #[derive(imp::TryFromBytes, imp::Immutable, imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Two { a: bool, @@ -51,6 +53,7 @@ fn two() { } #[derive(imp::KnownLayout, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Unsized { a: [u8], @@ -62,7 +65,7 @@ util_assert_impl_all!(Unsized: imp::TryFromBytes); fn un_sized() { // FIXME(#5): Use `try_transmute` in this test once it's available. let mut buf = [16u8, 12, 42]; - let candidate = ::zerocopy::Ptr::from_mut(&mut buf[..]); + let candidate = ::zerocopy_renamed::Ptr::from_mut(&mut buf[..]); // SAFETY: `&Unsized` consists entirely of initialized bytes. let candidate = unsafe { candidate.assume_initialized() }; @@ -78,6 +81,7 @@ fn un_sized() { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct TypeParams<'a, T: ?imp::Sized, I: imp::Iterator> { a: I::Item, @@ -96,6 +100,7 @@ util_assert_impl_all!(TypeParams<'static, [util::AU16], imp::IntoIter<()>>: imp: // parameters. #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::TryFromBytes, const N: usize>( imp::PhantomData<&'a &'b ()>, @@ -109,6 +114,7 @@ where util_assert_impl_all!(WithParams<'static, 'static, u8, 42>: imp::TryFromBytes); #[derive(imp::FromBytes, imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct MaybeFromBytes(T); @@ -124,6 +130,7 @@ fn test_maybe_from_bytes() { } #[derive(Debug, PartialEq, Eq, imp::TryFromBytes, imp::Immutable, imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct CPacked { a: u8, @@ -145,6 +152,7 @@ fn c_packed() { } #[derive(imp::TryFromBytes, imp::KnownLayout, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct CPackedUnsized { a: u8, @@ -166,6 +174,7 @@ fn c_packed_unsized() { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed)] struct PackedUnsized { a: u8, @@ -195,14 +204,17 @@ fn packed_unsized() { } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct A; #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct B { a: A, } #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct RawIdent { r#type: u8, diff --git a/zerocopy-derive/tests/struct_unaligned.rs b/zerocopy-derive/tests/struct_unaligned.rs index b2d78e4c9a..b8010d4e6e 100644 --- a/zerocopy-derive/tests/struct_unaligned.rs +++ b/zerocopy-derive/tests/struct_unaligned.rs @@ -19,6 +19,7 @@ include!("include.rs"); // - `repr(packed)` #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Foo { a: u8, @@ -27,6 +28,7 @@ struct Foo { util_assert_impl_all!(Foo: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct Bar { a: u8, @@ -35,6 +37,7 @@ struct Bar { util_assert_impl_all!(Bar: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed)] struct Baz { // NOTE: The `u16` type is not guaranteed to have alignment 2, although it @@ -50,6 +53,7 @@ struct Baz { util_assert_impl_all!(Baz: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(1))] struct FooAlign { a: u8, @@ -58,6 +62,7 @@ struct FooAlign { util_assert_impl_all!(FooAlign: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct Unsized { a: [u8], @@ -66,6 +71,7 @@ struct Unsized { util_assert_impl_all!(Unsized: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct TypeParams<'a, T: ?imp::Sized, I: imp::Iterator> { a: I::Item, @@ -83,6 +89,7 @@ util_assert_impl_all!(TypeParams<'static, [::core::primitive::u8], imp::IntoIter // Deriving `Unaligned` should work if the struct has bounded parameters. #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::Unaligned, const N: usize>( [T; N], diff --git a/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr b/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr index d4d6b56061..9e4a08cbeb 100644 --- a/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr +++ b/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr @@ -1,25 +1,25 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/derive_transparent.rs:34:1 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-msrv/derive_transparent.rs:35:1 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` | -note: required because of the requirements on the impl of `zerocopy::TryFromBytes` for `TransparentStruct` +note: required because of the requirements on the impl of `zerocopy_renamed::TryFromBytes` for `TransparentStruct` --> tests/ui-msrv/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-msrv/derive_transparent.rs:34:1 + --> tests/ui-msrv/derive_transparent.rs:35:1 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` = note: this error originates in the macro `::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-msrv/derive_transparent.rs:35:1 + --> tests/ui-msrv/derive_transparent.rs:36:1 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeros` is not implemented for `NotZerocopy` | note: required because of the requirements on the impl of `FromZeros` for `TransparentStruct` @@ -28,62 +28,62 @@ note: required because of the requirements on the impl of `FromZeros` for `Trans 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-msrv/derive_transparent.rs:35:1 + --> tests/ui-msrv/derive_transparent.rs:36:1 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` = note: this error originates in the macro `::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/derive_transparent.rs:36:1 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-msrv/derive_transparent.rs:37:1 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +37 | util_assert_impl_all!(TransparentStruct: FromBytes); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` | -note: required because of the requirements on the impl of `zerocopy::FromBytes` for `TransparentStruct` +note: required because of the requirements on the impl of `zerocopy_renamed::FromBytes` for `TransparentStruct` --> tests/ui-msrv/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-msrv/derive_transparent.rs:36:1 + --> tests/ui-msrv/derive_transparent.rs:37:1 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); +37 | util_assert_impl_all!(TransparentStruct: FromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` = note: this error originates in the macro `::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/derive_transparent.rs:37:1 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-msrv/derive_transparent.rs:38:1 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` | -note: required because of the requirements on the impl of `zerocopy::IntoBytes` for `TransparentStruct` +note: required because of the requirements on the impl of `zerocopy_renamed::IntoBytes` for `TransparentStruct` --> tests/ui-msrv/derive_transparent.rs:24:10 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-msrv/derive_transparent.rs:37:1 + --> tests/ui-msrv/derive_transparent.rs:38:1 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` = note: this error originates in the macro `::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/derive_transparent.rs:38:1 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/derive_transparent.rs:39:1 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` +39 | util_assert_impl_all!(TransparentStruct: Unaligned); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `NotZerocopy` | -note: required because of the requirements on the impl of `zerocopy::Unaligned` for `TransparentStruct` +note: required because of the requirements on the impl of `zerocopy_renamed::Unaligned` for `TransparentStruct` --> tests/ui-msrv/derive_transparent.rs:24:32 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-msrv/derive_transparent.rs:38:1 + --> tests/ui-msrv/derive_transparent.rs:39:1 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); +39 | util_assert_impl_all!(TransparentStruct: Unaligned); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` = note: this error originates in the macro `::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-msrv/enum.stderr b/zerocopy-derive/tests/ui-msrv/enum.stderr index 201bd3972b..8f2c25067c 100644 --- a/zerocopy-derive/tests/ui-msrv/enum.stderr +++ b/zerocopy-derive/tests/ui-msrv/enum.stderr @@ -1,294 +1,297 @@ error: unrecognized representation hint - --> tests/ui-msrv/enum.rs:19:8 + --> tests/ui-msrv/enum.rs:20:8 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^ error: unrecognized representation hint - --> tests/ui-msrv/enum.rs:25:8 + --> tests/ui-msrv/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:30:10 + --> tests/ui-msrv/enum.rs:32:10 | -30 | #[derive(FromBytes)] +32 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-msrv/enum.rs:37:12 + --> tests/ui-msrv/enum.rs:41:12 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:42:10 + --> tests/ui-msrv/enum.rs:46:10 | -42 | #[derive(FromBytes)] +46 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:70:1 + --> tests/ui-msrv/enum.rs:78:1 | -70 | enum TryFromBytes1 { - | ^^^^ +78 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:75:1 + --> tests/ui-msrv/enum.rs:84:1 | -75 | enum TryFromBytes2 { - | ^^^^ +84 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:93:1 - | -93 | enum FromZeros1 { - | ^^^^ + --> tests/ui-msrv/enum.rs:104:1 + | +104 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:98:1 - | -98 | enum FromZeros2 { - | ^^^^ + --> tests/ui-msrv/enum.rs:110:1 + | +110 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:104:1 + --> tests/ui-msrv/enum.rs:117:1 | -104 | enum FromZeros3 { - | ^^^^ +117 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-msrv/enum.rs:110:1 - | -110 | / #[repr(u8)] -111 | | enum FromZeros4 { -112 | | A = 1, -113 | | B = 2, -114 | | } + --> tests/ui-msrv/enum.rs:124:1 + | +124 | / #[zerocopy(crate = "zerocopy_renamed")] +125 | | #[repr(u8)] +126 | | enum FromZeros4 { +127 | | A = 1, +128 | | B = 2, +129 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` help: This enum has discriminants which are not literal integers. One of those may define or imply which variant has a discriminant of zero. Use a literal integer to define or imply the variant with a discriminant of zero. - --> tests/ui-msrv/enum.rs:119:1 + --> tests/ui-msrv/enum.rs:134:1 | -119 | / #[repr(i8)] -120 | | enum FromZeros5 { -121 | | A = NEGATIVE_ONE, -122 | | B, -123 | | } +134 | / #[zerocopy(crate = "zerocopy_renamed")] +135 | | #[repr(i8)] +136 | | enum FromZeros5 { +137 | | A = NEGATIVE_ONE, +138 | | B, +139 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-msrv/enum.rs:134:1 - | -134 | / #[repr(u8)] -135 | | enum FromZeros7 { -136 | | A = 1, -137 | | B(NotFromZeros), -138 | | } + --> tests/ui-msrv/enum.rs:151:1 + | +151 | / #[zerocopy(crate = "zerocopy_renamed")] +152 | | #[repr(u8)] +153 | | enum FromZeros7 { +154 | | A = 1, +155 | | B(NotFromZeros), +156 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:144:10 + --> tests/ui-msrv/enum.rs:162:10 | -144 | #[derive(FromBytes)] +162 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:150:8 + --> tests/ui-msrv/enum.rs:170:8 | -150 | #[repr(C)] +170 | #[repr(C)] | ^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:156:8 + --> tests/ui-msrv/enum.rs:177:8 | -156 | #[repr(usize)] +177 | #[repr(usize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:162:8 + --> tests/ui-msrv/enum.rs:184:8 | -162 | #[repr(isize)] +184 | #[repr(isize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:168:8 + --> tests/ui-msrv/enum.rs:191:8 | -168 | #[repr(u32)] +191 | #[repr(u32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:174:8 + --> tests/ui-msrv/enum.rs:198:8 | -174 | #[repr(i32)] +198 | #[repr(i32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:180:8 + --> tests/ui-msrv/enum.rs:205:8 | -180 | #[repr(u64)] +205 | #[repr(u64)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-msrv/enum.rs:186:8 + --> tests/ui-msrv/enum.rs:212:8 | -186 | #[repr(i64)] +212 | #[repr(i64)] | ^^^ error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:456:10 + --> tests/ui-msrv/enum.rs:483:10 | -456 | #[derive(Unaligned)] +483 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:462:10 + --> tests/ui-msrv/enum.rs:490:10 | -462 | #[derive(Unaligned)] +490 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:468:10 + --> tests/ui-msrv/enum.rs:497:10 | -468 | #[derive(Unaligned)] +497 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:474:10 + --> tests/ui-msrv/enum.rs:504:10 | -474 | #[derive(Unaligned)] +504 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:480:10 + --> tests/ui-msrv/enum.rs:511:10 | -480 | #[derive(Unaligned)] +511 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:486:10 + --> tests/ui-msrv/enum.rs:518:10 | -486 | #[derive(Unaligned)] +518 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:492:10 + --> tests/ui-msrv/enum.rs:525:10 | -492 | #[derive(Unaligned)] +525 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:498:10 + --> tests/ui-msrv/enum.rs:532:10 | -498 | #[derive(Unaligned)] +532 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/enum.rs:504:10 + --> tests/ui-msrv/enum.rs:539:10 | -504 | #[derive(Unaligned)] +539 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-msrv/enum.rs:511:12 + --> tests/ui-msrv/enum.rs:548:12 | -511 | #[repr(u8, align(2))] +548 | #[repr(u8, align(2))] | ^^^^^ error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-msrv/enum.rs:517:12 + --> tests/ui-msrv/enum.rs:555:12 | -517 | #[repr(i8, align(2))] +555 | #[repr(i8, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/enum.rs:523:18 + --> tests/ui-msrv/enum.rs:562:18 | -523 | #[repr(align(1), align(2))] +562 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/enum.rs:529:18 + --> tests/ui-msrv/enum.rs:569:18 | -529 | #[repr(align(2), align(4))] +569 | #[repr(align(2), align(4))] | ^^^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:562:10 + --> tests/ui-msrv/enum.rs:606:10 | -562 | #[derive(IntoBytes)] +606 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/enum.rs:568:10 + --> tests/ui-msrv/enum.rs:613:10 | -568 | #[derive(IntoBytes)] +613 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: generic parameters may not be used in const operations - --> tests/ui-msrv/enum.rs:576:7 + --> tests/ui-msrv/enum.rs:623:7 | -576 | A(T), +623 | A(T), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants - --> tests/ui-msrv/enum.rs:136:9 + --> tests/ui-msrv/enum.rs:154:9 | -136 | A = 1, +154 | A = 1, | ^ disallowed custom discriminant -137 | B(NotFromZeros), +155 | B(NotFromZeros), | --------------- tuple variant defined here | = note: see issue #60553 for more information error[E0565]: meta item in `repr` must be an identifier - --> tests/ui-msrv/enum.rs:19:8 + --> tests/ui-msrv/enum.rs:20:8 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^ error[E0552]: unrecognized representation hint - --> tests/ui-msrv/enum.rs:25:8 + --> tests/ui-msrv/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ error[E0566]: conflicting representation hints - --> tests/ui-msrv/enum.rs:37:8 + --> tests/ui-msrv/enum.rs:41:8 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^ ^^^ | = note: `#[deny(conflicting_repr_hints)]` on by default @@ -296,63 +299,63 @@ error[E0566]: conflicting representation hints = note: for more information, see issue #68585 error[E0277]: the trait bound `UnsafeCell<()>: Immutable` is not satisfied - --> tests/ui-msrv/enum.rs:51:10 + --> tests/ui-msrv/enum.rs:56:10 | -51 | #[derive(Immutable)] +56 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell<()>` | = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `UnsafeCell: Immutable` is not satisfied - --> tests/ui-msrv/enum.rs:59:10 + --> tests/ui-msrv/enum.rs:66:10 | -59 | #[derive(Immutable)] +66 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell` | = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotTryFromBytes: TryFromBytes` is not satisfied - --> tests/ui-msrv/enum.rs:82:10 + --> tests/ui-msrv/enum.rs:92:10 | -82 | #[derive(TryFromBytes)] +92 | #[derive(TryFromBytes)] | ^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotTryFromBytes` | = help: see issue #48214 = note: this error originates in the derive macro `TryFromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotFromZeros: TryFromBytes` is not satisfied - --> tests/ui-msrv/enum.rs:127:10 + --> tests/ui-msrv/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotFromZeros` | = help: see issue #48214 = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotFromZeros: FromZeros` is not satisfied - --> tests/ui-msrv/enum.rs:127:10 + --> tests/ui-msrv/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ the trait `FromZeros` is not implemented for `NotFromZeros` | = help: see issue #48214 = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `bool: FromBytes` is not satisfied - --> tests/ui-msrv/enum.rs:191:10 + --> tests/ui-msrv/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromBytes` is not implemented for `bool` | = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/enum.rs:538:10 + --> tests/ui-msrv/enum.rs:578:10 | -538 | #[derive(IntoBytes)] +578 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -361,9 +364,9 @@ error[E0277]: the trait bound `(): PaddingFree` is not sati = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/enum.rs:549:10 + --> tests/ui-msrv/enum.rs:591:10 | -549 | #[derive(IntoBytes)] +591 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -372,9 +375,9 @@ error[E0277]: the trait bound `(): PaddingFree` is not sati = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/enum.rs:555:10 + --> tests/ui-msrv/enum.rs:598:10 | -555 | #[derive(IntoBytes)] +598 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -383,14 +386,14 @@ error[E0277]: the trait bound `(): PaddingFree` is not sati = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: generic `Self` types are currently not permitted in anonymous constants - --> tests/ui-msrv/enum.rs:573:10 + --> tests/ui-msrv/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ | note: not a concrete type - --> tests/ui-msrv/enum.rs:573:10 + --> tests/ui-msrv/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr b/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr index ff828dccba..63eb20272c 100644 --- a/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr +++ b/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr @@ -1,11 +1,11 @@ error: FromBytes only supported on repr(u8) enum with 256 variants --> tests/ui-msrv/enum_from_bytes_u8_too_few.rs:15:1 | -15 | / #[repr(u8)] -16 | | enum Foo { -17 | | Variant0, -18 | | Variant1, +15 | / #[zerocopy(crate = "zerocopy_renamed")] +16 | | #[repr(u8)] +17 | | enum Foo { +18 | | Variant0, ... | -271 | | Variant254, -272 | | } +272 | | Variant254, +273 | | } | |_^ diff --git a/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr b/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr index c5112fd5d8..5c41a95124 100644 --- a/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr @@ -1,97 +1,97 @@ -warning: unused import: `zerocopy::KnownLayout` +warning: unused import: `zerocopy_renamed::KnownLayout` --> tests/ui-msrv/late_compile_pass.rs:15:5 | -15 | use zerocopy::KnownLayout; - | ^^^^^^^^^^^^^^^^^^^^^ +15 | use zerocopy_renamed::KnownLayout; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied --> tests/ui-msrv/late_compile_pass.rs:29:10 | 29 | #[derive(TryFromBytes)] - | ^^^^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^ the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `TryFromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:38:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] - | ^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +39 | #[derive(FromZeros)] + | ^^^^^^^^^ the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:38:10 + --> tests/ui-msrv/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] +39 | #[derive(FromZeros)] | ^^^^^^^^^ the trait `FromZeros` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] - | ^^^^^^^^^ the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +49 | #[derive(FromBytes)] + | ^^^^^^^^^ the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:47:10 + --> tests/ui-msrv/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromZeros` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] - | ^^^^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +49 | #[derive(FromBytes)] + | ^^^^^^^^^ the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:56:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:59:10 | -56 | #[derive(IntoBytes)] - | ^^^^^^^^^ the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +59 | #[derive(IntoBytes)] + | ^^^^^^^^^ the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` | = help: see issue #48214 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:66:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:70:10 | -66 | #[derive(Unaligned)] - | ^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` +70 | #[derive(Unaligned)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` | = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:74:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:79:10 | -74 | #[derive(Unaligned)] - | ^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` +79 | #[derive(Unaligned)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` | = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/late_compile_pass.rs:81:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/late_compile_pass.rs:87:10 | -81 | #[derive(Unaligned)] - | ^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` +87 | #[derive(Unaligned)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` | = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr b/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr index 9648856ad6..24cb078c15 100644 --- a/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr @@ -1,32 +1,32 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied - --> tests/ui-msrv/mid_compile_pass.rs:59:26 + --> tests/ui-msrv/mid_compile_pass.rs:63:26 | -59 | fn test_kl13(t: T) -> impl KnownLayout { +63 | fn test_kl13(t: T) -> impl KnownLayout { | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T` | note: required because of the requirements on the impl of `KnownLayout` for `KL13` - --> tests/ui-msrv/mid_compile_pass.rs:55:10 + --> tests/ui-msrv/mid_compile_pass.rs:58:10 | -55 | #[derive(KnownLayout)] +58 | #[derive(KnownLayout)] | ^^^^^^^^^^^ = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | -59 | fn test_kl13(t: T) -> impl KnownLayout { - | +++++++++++++++++++++++ +63 | fn test_kl13(t: T) -> impl KnownLayout { + | +++++++++++++++++++++++++++++++ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-msrv/mid_compile_pass.rs:31:15 + --> tests/ui-msrv/mid_compile_pass.rs:32:15 | -30 | fn test_kl04(kl: &KL04) { +31 | fn test_kl04(kl: &KL04) { | - this type parameter needs to be `std::marker::Sized` -31 | assert_kl(kl); +32 | assert_kl(kl); | ^^ doesn't have a size known at compile-time | note: required because it appears within the type `KL04` - --> tests/ui-msrv/mid_compile_pass.rs:28:8 + --> tests/ui-msrv/mid_compile_pass.rs:29:8 | -28 | struct KL04(u8, T); +29 | struct KL04(u8, T); | ^^^^ note: required because of the requirements on the impl of `KnownLayout` for `KL04` --> tests/ui-msrv/mid_compile_pass.rs:27:10 @@ -41,27 +41,27 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -30 - fn test_kl04(kl: &KL04) { -30 + fn test_kl04(kl: &KL04) { +31 - fn test_kl04(kl: &KL04) { +31 + fn test_kl04(kl: &KL04) { | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-msrv/mid_compile_pass.rs:40:15 + --> tests/ui-msrv/mid_compile_pass.rs:42:15 | -39 | fn test_kl06(kl: &KL06) { +41 | fn test_kl06(kl: &KL06) { | - this type parameter needs to be `std::marker::Sized` -40 | assert_kl(kl); +42 | assert_kl(kl); | ^^ doesn't have a size known at compile-time | note: required because it appears within the type `KL06` - --> tests/ui-msrv/mid_compile_pass.rs:37:8 + --> tests/ui-msrv/mid_compile_pass.rs:39:8 | -37 | struct KL06(u8, T); +39 | struct KL06(u8, T); | ^^^^ note: required because of the requirements on the impl of `KnownLayout` for `KL06` - --> tests/ui-msrv/mid_compile_pass.rs:36:10 + --> tests/ui-msrv/mid_compile_pass.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ note: required by a bound in `assert_kl` --> tests/ui-msrv/mid_compile_pass.rs:23:26 @@ -71,23 +71,23 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -39 - fn test_kl06(kl: &KL06) { -39 + fn test_kl06(kl: &KL06) { +41 - fn test_kl06(kl: &KL06) { +41 + fn test_kl06(kl: &KL06) { | error[E0277]: the trait bound `T: KnownLayout` is not satisfied - --> tests/ui-msrv/mid_compile_pass.rs:50:15 + --> tests/ui-msrv/mid_compile_pass.rs:53:15 | -50 | assert_kl(kl) +53 | assert_kl(kl) | ^^ | | | expected an implementor of trait `KnownLayout` | help: consider borrowing here: `&kl` | note: required because of the requirements on the impl of `KnownLayout` for `KL12` - --> tests/ui-msrv/mid_compile_pass.rs:45:10 + --> tests/ui-msrv/mid_compile_pass.rs:47:10 | -45 | #[derive(KnownLayout)] +47 | #[derive(KnownLayout)] | ^^^^^^^^^^^ note: required by a bound in `assert_kl` --> tests/ui-msrv/mid_compile_pass.rs:23:26 diff --git a/zerocopy-derive/tests/ui-msrv/msrv_specific.rs b/zerocopy-derive/tests/ui-msrv/msrv_specific.rs index 6e1ea5b3f6..9018add36c 100644 --- a/zerocopy-derive/tests/ui-msrv/msrv_specific.rs +++ b/zerocopy-derive/tests/ui-msrv/msrv_specific.rs @@ -10,12 +10,12 @@ // compiler pass compared to the stable or nightly toolchains. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; #[path = "../include.rs"] mod util; -use zerocopy::IntoBytes; +use zerocopy_renamed::IntoBytes; use self::util::util::AU16; @@ -23,6 +23,7 @@ fn main() {} // `repr(C, packed(2))` is not equivalent to `repr(C, packed)`. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(2))] struct IntoBytes1 { t0: T, diff --git a/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr b/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr index 2574f905be..45c77b7052 100644 --- a/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr +++ b/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr @@ -6,20 +6,20 @@ warning: unused `#[macro_use]` import | = note: `#[warn(unused_imports)]` on by default -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/msrv_specific.rs:36:9 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/msrv_specific.rs:37:9 | -36 | is_into_bytes_1::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` +37 | is_into_bytes_1::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` | -note: required because of the requirements on the impl of `zerocopy::IntoBytes` for `IntoBytes1` +note: required because of the requirements on the impl of `zerocopy_renamed::IntoBytes` for `IntoBytes1` --> tests/ui-msrv/msrv_specific.rs:25:10 | 25 | #[derive(IntoBytes)] | ^^^^^^^^^ note: required by a bound in `is_into_bytes_1` - --> tests/ui-msrv/msrv_specific.rs:34:23 + --> tests/ui-msrv/msrv_specific.rs:35:23 | -34 | fn is_into_bytes_1() { +35 | fn is_into_bytes_1() { | ^^^^^^^^^ required by this bound in `is_into_bytes_1` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-msrv/privacy.stderr b/zerocopy-derive/tests/ui-msrv/privacy.stderr index 97d310db9c..1c30df6786 100644 --- a/zerocopy-derive/tests/ui-msrv/privacy.stderr +++ b/zerocopy-derive/tests/ui-msrv/privacy.stderr @@ -1,143 +1,143 @@ error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:74:60 + --> tests/ui-msrv/privacy.rs:96:9 | -74 | let _: >::Type = - | ^ +96 | _, + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:76:60 - | -76 | let _: >::Type = - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:101:9 + | +101 | _, + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:81:59 - | -81 | let _: >::Type = - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:109:9 + | +109 | _, + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:83:59 - | -83 | let _: >::Type = - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:114:9 + | +114 | _, + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:88:44 - | -88 | let _: >::Type = 0u8; - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:120:52 + | +120 | let _: >::Type = + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:89:44 - | -89 | let _: >::Type = 0u16; - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:122:52 + | +122 | let _: >::Type = + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:93:43 - | -93 | let _: >::Type = 0u8; - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:127:51 + | +127 | let _: >::Type = + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:94:43 - | -94 | let _: >::Type = 0u16; - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:129:51 + | +129 | let _: >::Type = + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:96:43 - | -96 | let _: >::Type = 0u8; - | ^ - | - = help: const arguments cannot yet be inferred with `_` + --> tests/ui-msrv/privacy.rs:132:51 + | +132 | let _: >::Type = + | ^ + | + = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:28:64 + --> tests/ui-msrv/privacy.rs:31:13 | -28 | let _: >::Type = 0u8; - | ^ +31 | _, + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:29:64 + --> tests/ui-msrv/privacy.rs:36:13 | -29 | let _: >::Type = 0u16; - | ^ +36 | _, + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:36:63 + --> tests/ui-msrv/privacy.rs:48:13 | -36 | let _: >::Type = 0u8; - | ^ +48 | _, + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:37:63 + --> tests/ui-msrv/privacy.rs:53:13 | -37 | let _: >::Type = 0u16; - | ^ +53 | _, + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:47:48 + --> tests/ui-msrv/privacy.rs:66:56 | -47 | let _: >::Type = 0u8; - | ^ +66 | let _: >::Type = 0u8; + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:48:48 + --> tests/ui-msrv/privacy.rs:67:56 | -48 | let _: >::Type = 0u16; - | ^ +67 | let _: >::Type = 0u16; + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:59:47 + --> tests/ui-msrv/privacy.rs:79:55 | -59 | let _: >::Type = 0u8; - | ^ +79 | let _: >::Type = 0u8; + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:60:47 + --> tests/ui-msrv/privacy.rs:80:55 | -60 | let _: >::Type = 0u16; - | ^ +80 | let _: >::Type = 0u16; + | ^ | = help: const arguments cannot yet be inferred with `_` error[E0747]: type provided when a constant was expected - --> tests/ui-msrv/privacy.rs:62:47 + --> tests/ui-msrv/privacy.rs:82:55 | -62 | let _: >::Type = 0u8; - | ^ +82 | let _: >::Type = 0u8; + | ^ | = help: const arguments cannot yet be inferred with `_` diff --git a/zerocopy-derive/tests/ui-msrv/struct.stderr b/zerocopy-derive/tests/ui-msrv/struct.stderr index efb5e058d8..c83744c44e 100644 --- a/zerocopy-derive/tests/ui-msrv/struct.stderr +++ b/zerocopy-derive/tests/ui-msrv/struct.stderr @@ -1,89 +1,89 @@ error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:167:11 + --> tests/ui-msrv/struct.rs:185:11 | -167 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs +185 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs | ^ error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/struct.rs:172:10 + --> tests/ui-msrv/struct.rs:190:10 | -172 | #[derive(IntoBytes)] +190 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/struct.rs:177:10 + --> tests/ui-msrv/struct.rs:196:10 | -177 | #[derive(IntoBytes)] +196 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-msrv/struct.rs:200:10 + --> tests/ui-msrv/struct.rs:221:10 | -200 | #[derive(IntoBytes)] +221 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-msrv/struct.rs:211:11 + --> tests/ui-msrv/struct.rs:234:11 | -211 | #[repr(C, align(2))] +234 | #[repr(C, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:215:8 + --> tests/ui-msrv/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:221:16 + --> tests/ui-msrv/struct.rs:246:16 | -221 | #[repr(packed, align(2))] +246 | #[repr(packed, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:225:18 + --> tests/ui-msrv/struct.rs:251:18 | -225 | #[repr(align(1), align(2))] +251 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:229:18 + --> tests/ui-msrv/struct.rs:256:18 | -229 | #[repr(align(2), align(4))] +256 | #[repr(align(2), align(4))] | ^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/struct.rs:232:10 + --> tests/ui-msrv/struct.rs:259:10 | -232 | #[derive(Unaligned)] +259 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/struct.rs:235:10 + --> tests/ui-msrv/struct.rs:263:10 | -235 | #[derive(Unaligned)] +263 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-msrv/struct.rs:245:8 + --> tests/ui-msrv/struct.rs:275:8 | -245 | #[repr(C, packed(2))] +275 | #[repr(C, packed(2))] | ^ error[E0692]: transparent struct cannot have other repr hints - --> tests/ui-msrv/struct.rs:215:8 + --> tests/ui-msrv/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ ^^^^^^^^ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time @@ -94,78 +94,78 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL00` - --> tests/ui-msrv/struct.rs:32:8 + --> tests/ui-msrv/struct.rs:33:8 | -32 | struct KL00(u8, NotKnownLayoutDst); +33 | struct KL00(u8, NotKnownLayoutDst); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-msrv/struct.rs:36:10 + --> tests/ui-msrv/struct.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL02` - --> tests/ui-msrv/struct.rs:37:8 + --> tests/ui-msrv/struct.rs:39:8 | -37 | struct KL02(u8, [u8]); +39 | struct KL02(u8, [u8]); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy::KnownLayout` is not satisfied - --> tests/ui-msrv/struct.rs:41:10 +error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-msrv/struct.rs:43:10 | -41 | #[derive(KnownLayout)] - | ^^^^^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayoutDst` +43 | #[derive(KnownLayout)] + | ^^^^^^^^^^^ the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayoutDst` | = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-msrv/struct.rs:47:10 +error[E0277]: the trait bound `NotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-msrv/struct.rs:50:10 | -47 | #[derive(KnownLayout)] - | ^^^^^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayout` +50 | #[derive(KnownLayout)] + | ^^^^^^^^^^^ the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayout` | = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/struct.rs:55:10 +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-msrv/struct.rs:59:10 | -55 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` +59 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell: zerocopy::Immutable` is not satisfied - --> tests/ui-msrv/struct.rs:60:10 +error[E0277]: the trait bound `UnsafeCell: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-msrv/struct.rs:65:10 | -60 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell` +65 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell` | - = note: required because of the requirements on the impl of `zerocopy::Immutable` for `[UnsafeCell; 0]` + = note: required because of the requirements on the impl of `zerocopy_renamed::Immutable` for `[UnsafeCell; 0]` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-msrv/struct.rs:100:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-msrv/struct.rs:110:10 | -100 | #[derive(IntoBytes)] - | ^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` +110 | #[derive(IntoBytes)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` | = help: see issue #48214 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/struct.rs:107:10 + --> tests/ui-msrv/struct.rs:118:10 | -107 | #[derive(IntoBytes)] +118 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -174,9 +174,9 @@ error[E0277]: the trait bound `(): PaddingFree` is not sati = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/struct.rs:114:10 + --> tests/ui-msrv/struct.rs:126:10 | -114 | #[derive(IntoBytes)] +126 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -185,28 +185,28 @@ error[E0277]: the trait bound `(): PaddingFree` is not sati = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-msrv/struct.rs:130:10 + --> tests/ui-msrv/struct.rs:143:10 | -130 | #[derive(IntoBytes)] +143 | #[derive(IntoBytes)] | ^^^^^^^^^ doesn't have a size known at compile-time | = help: within `IntoBytes4`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `IntoBytes4` - --> tests/ui-msrv/struct.rs:132:8 + --> tests/ui-msrv/struct.rs:146:8 | -132 | struct IntoBytes4 { +146 | struct IntoBytes4 { | ^^^^^^^^^^ note: required by a bound in `std::mem::size_of` --> $RUST/core/src/mem/mod.rs | | pub const fn size_of() -> usize { | ^ required by this bound in `std::mem::size_of` - = note: this error originates in the macro `::zerocopy::struct_padding` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `::zerocopy_renamed::struct_padding` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-msrv/struct.rs:134:8 + --> tests/ui-msrv/struct.rs:148:8 | -134 | b: SliceU8, +148 | b: SliceU8, | ^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` @@ -217,9 +217,9 @@ note: required by a bound in `std::mem::size_of` | ^ required by this bound in `std::mem::size_of` error[E0277]: the trait bound `(): DynamicPaddingFree` is not satisfied - --> tests/ui-msrv/struct.rs:139:10 + --> tests/ui-msrv/struct.rs:153:10 | -139 | #[derive(IntoBytes)] +153 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `DynamicPaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -228,9 +228,9 @@ error[E0277]: the trait bound `(): DynamicPaddingFree` is not = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): DynamicPaddingFree` is not satisfied - --> tests/ui-msrv/struct.rs:148:10 + --> tests/ui-msrv/struct.rs:163:10 | -148 | #[derive(IntoBytes)] +163 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `DynamicPaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -239,9 +239,9 @@ error[E0277]: the trait bound `(): DynamicPaddingFree` is not = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): DynamicPaddingFree` is not satisfied - --> tests/ui-msrv/struct.rs:158:10 + --> tests/ui-msrv/struct.rs:174:10 | -158 | #[derive(IntoBytes)] +174 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `DynamicPaddingFree` is not implemented for `()` | = help: the following implementations were found: @@ -249,11 +249,11 @@ error[E0277]: the trait bound `(): DynamicPaddingFree` is not = help: see issue #48214 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-msrv/struct.rs:248:10 +error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-msrv/struct.rs:278:10 | -248 | #[derive(SplitAt)] - | ^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `SplitAtNotKnownLayout` +278 | #[derive(SplitAt)] + | ^^^^^^^ the trait `zerocopy_renamed::KnownLayout` is not implemented for `SplitAtNotKnownLayout` | note: required by a bound in `SplitAt` --> $WORKSPACE/src/split_at.rs @@ -263,18 +263,18 @@ note: required by a bound in `SplitAt` = note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `u8: SplitAt` is not satisfied - --> tests/ui-msrv/struct.rs:252:10 + --> tests/ui-msrv/struct.rs:283:10 | -252 | #[derive(SplitAt, KnownLayout)] +283 | #[derive(SplitAt, KnownLayout)] | ^^^^^^^ the trait `SplitAt` is not implemented for `u8` | = help: see issue #48214 = note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0271]: type mismatch resolving `::PointerMetadata == usize` - --> tests/ui-msrv/struct.rs:252:10 +error[E0271]: type mismatch resolving `::PointerMetadata == usize` + --> tests/ui-msrv/struct.rs:283:10 | -252 | #[derive(SplitAt, KnownLayout)] +283 | #[derive(SplitAt, KnownLayout)] | ^^^^^^^ expected `()`, found `usize` | = help: see issue #48214 diff --git a/zerocopy-derive/tests/ui-msrv/union.stderr b/zerocopy-derive/tests/ui-msrv/union.stderr index 1958575869..356cedc9b4 100644 --- a/zerocopy-derive/tests/ui-msrv/union.stderr +++ b/zerocopy-derive/tests/ui-msrv/union.stderr @@ -1,81 +1,81 @@ error: unsupported on types with type parameters - --> tests/ui-msrv/union.rs:34:10 + --> tests/ui-msrv/union.rs:35:10 | -34 | #[derive(IntoBytes)] +35 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-msrv/union.rs:48:10 + --> tests/ui-msrv/union.rs:51:10 | -48 | #[derive(IntoBytes)] +51 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-msrv/union.rs:54:10 + --> tests/ui-msrv/union.rs:58:10 | -54 | #[derive(IntoBytes)] +58 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-msrv/union.rs:65:11 + --> tests/ui-msrv/union.rs:71:11 | -65 | #[repr(C, align(2))] +71 | #[repr(C, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/union.rs:81:16 + --> tests/ui-msrv/union.rs:88:16 | -81 | #[repr(packed, align(2))] +88 | #[repr(packed, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/union.rs:87:18 + --> tests/ui-msrv/union.rs:95:18 | -87 | #[repr(align(1), align(2))] +95 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-msrv/union.rs:93:18 - | -93 | #[repr(align(2), align(4))] - | ^^^^^ + --> tests/ui-msrv/union.rs:102:18 + | +102 | #[repr(align(2), align(4))] + | ^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/union.rs:98:10 - | -98 | #[derive(Unaligned)] - | ^^^^^^^^^ - | - = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui-msrv/union.rs:107:10 + | +107 | #[derive(Unaligned)] + | ^^^^^^^^^ + | + = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-msrv/union.rs:104:10 + --> tests/ui-msrv/union.rs:114:10 | -104 | #[derive(Unaligned)] +114 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied --> tests/ui-msrv/union.rs:25:10 | 25 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | - = note: required because of the requirements on the impl of `zerocopy::Immutable` for `ManuallyDrop>` + = note: required because of the requirements on the impl of `zerocopy_renamed::Immutable` for `ManuallyDrop>` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `(): PaddingFree` is not satisfied - --> tests/ui-msrv/union.rs:40:10 + --> tests/ui-msrv/union.rs:42:10 | -40 | #[derive(IntoBytes)] +42 | #[derive(IntoBytes)] | ^^^^^^^^^ the trait `PaddingFree` is not implemented for `()` | = help: the following implementations were found: diff --git a/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs b/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs index ce531a4bb6..5519fb5f99 100644 --- a/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs +++ b/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs @@ -13,12 +13,13 @@ //! test will fail because more than one compile error will be generated. #![deny(deprecated)] -extern crate zerocopy; +extern crate zerocopy_renamed; -use zerocopy::IntoBytes; +use zerocopy_renamed::IntoBytes; #[deprecated = "Do not use"] #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct OldHeader { field_a: usize, diff --git a/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr b/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr index 49fa697e20..7a43a1fc14 100644 --- a/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr +++ b/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr @@ -1,7 +1,7 @@ error: use of deprecated struct `OldHeader`: Do not use - --> tests/ui-nightly/absence_of_deprecated_warning.rs:31:12 + --> tests/ui-nightly/absence_of_deprecated_warning.rs:32:12 | -31 | impl T for OldHeader {} +32 | impl T for OldHeader {} | ^^^^^^^^^ | note: the lint level is defined here diff --git a/zerocopy-derive/tests/ui-nightly/derive_transparent.rs b/zerocopy-derive/tests/ui-nightly/derive_transparent.rs index a60c89e243..bf4fcab363 100644 --- a/zerocopy-derive/tests/ui-nightly/derive_transparent.rs +++ b/zerocopy-derive/tests/ui-nightly/derive_transparent.rs @@ -6,14 +6,14 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; +extern crate zerocopy_renamed; #[path = "../include.rs"] mod util; use core::marker::PhantomData; -use zerocopy::{FromBytes, FromZeros, IntoBytes, TryFromBytes, Unaligned}; +use zerocopy_renamed::{FromBytes, FromZeros, IntoBytes, TryFromBytes, Unaligned}; use self::util::util::NotZerocopy; @@ -22,6 +22,7 @@ fn main() {} // Test generic transparent structs #[derive(IntoBytes, FromBytes, Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct TransparentStruct { inner: T, diff --git a/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr b/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr index 6987e75ac6..487070f009 100644 --- a/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr +++ b/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/derive_transparent.rs:34:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-nightly/derive_transparent.rs:35:23 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -20,7 +20,7 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `TransparentStruct` to implement `zerocopy::TryFromBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::TryFromBytes` --> tests/ui-nightly/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] @@ -31,16 +31,16 @@ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` | ::static_assertions::assert_impl_all!($type: $($trait),+); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | - ::: tests/ui-nightly/derive_transparent.rs:34:1 + ::: tests/ui-nightly/derive_transparent.rs:35:1 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); | ------------------------------------------------------------------- in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-nightly/derive_transparent.rs:35:23 + --> tests/ui-nightly/derive_transparent.rs:36:23 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -70,25 +70,25 @@ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` | ::static_assertions::assert_impl_all!($type: $($trait),+); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | - ::: tests/ui-nightly/derive_transparent.rs:35:1 + ::: tests/ui-nightly/derive_transparent.rs:36:1 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ---------------------------------------------------------------- in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/derive_transparent.rs:36:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-nightly/derive_transparent.rs:37:23 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); +37 | util_assert_impl_all!(TransparentStruct: FromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -98,7 +98,7 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `TransparentStruct` to implement `zerocopy::FromBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::FromBytes` --> tests/ui-nightly/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] @@ -109,25 +109,25 @@ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` | ::static_assertions::assert_impl_all!($type: $($trait),+); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | - ::: tests/ui-nightly/derive_transparent.rs:36:1 + ::: tests/ui-nightly/derive_transparent.rs:37:1 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); +37 | util_assert_impl_all!(TransparentStruct: FromBytes); | ---------------------------------------------------------------- in this macro invocation = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/derive_transparent.rs:37:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-nightly/derive_transparent.rs:38:23 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `zerocopy_renamed::IntoBytes`: () AU16 AtomicBool @@ -137,7 +137,7 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicI8 AtomicIsize and $N others -note: required for `TransparentStruct` to implement `zerocopy::IntoBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::IntoBytes` --> tests/ui-nightly/derive_transparent.rs:24:10 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] @@ -148,25 +148,25 @@ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` | ::static_assertions::assert_impl_all!($type: $($trait),+); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | - ::: tests/ui-nightly/derive_transparent.rs:37:1 + ::: tests/ui-nightly/derive_transparent.rs:38:1 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); | ---------------------------------------------------------------- in this macro invocation = note: this error originates in the derive macro `IntoBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/derive_transparent.rs:38:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/derive_transparent.rs:39:23 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); +39 | util_assert_impl_all!(TransparentStruct: Unaligned); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -176,7 +176,7 @@ help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` F64 I128 and $N others -note: required for `TransparentStruct` to implement `zerocopy::Unaligned` +note: required for `TransparentStruct` to implement `zerocopy_renamed::Unaligned` --> tests/ui-nightly/derive_transparent.rs:24:32 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] @@ -187,8 +187,8 @@ note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` | ::static_assertions::assert_impl_all!($type: $($trait),+); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | - ::: tests/ui-nightly/derive_transparent.rs:38:1 + ::: tests/ui-nightly/derive_transparent.rs:39:1 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); +39 | util_assert_impl_all!(TransparentStruct: Unaligned); | ---------------------------------------------------------------- in this macro invocation = note: this error originates in the derive macro `Unaligned` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-nightly/enum.rs b/zerocopy-derive/tests/ui-nightly/enum.rs index 82b43d80ff..33c39eb42e 100644 --- a/zerocopy-derive/tests/ui-nightly/enum.rs +++ b/zerocopy-derive/tests/ui-nightly/enum.rs @@ -7,7 +7,7 @@ // those terms. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; fn main() {} @@ -16,30 +16,35 @@ fn main() {} // #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr("foo")] enum Generic1 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(foo)] enum Generic2 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] enum Generic3 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8, u16)] enum Generic4 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum Generic5 { A, } @@ -49,14 +54,17 @@ enum Generic5 { // #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Immutable1 { A(core::cell::UnsafeCell<()>), } #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Never {} #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] enum Immutable2 { Uninhabited(Never, core::cell::UnsafeCell), Inhabited(u8), @@ -67,11 +75,13 @@ enum Immutable2 { // #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum TryFromBytes1 { A, } #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum TryFromBytes2 { A, B(u8), @@ -80,6 +90,7 @@ enum TryFromBytes2 { struct NotTryFromBytes; #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum TryFromBytes3 { A(NotTryFromBytes), @@ -90,23 +101,27 @@ enum TryFromBytes3 { // #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] enum FromZeros1 { A(u8), } #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] enum FromZeros2 { A, B(u8), } #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] enum FromZeros3 { A = 1, B, } #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FromZeros4 { A = 1, @@ -116,6 +131,7 @@ enum FromZeros4 { const NEGATIVE_ONE: i8 = -1; #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8)] enum FromZeros5 { A = NEGATIVE_ONE, @@ -125,12 +141,14 @@ enum FromZeros5 { struct NotFromZeros; #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FromZeros6 { A(NotFromZeros), } #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FromZeros7 { A = 1, @@ -142,53 +160,62 @@ enum FromZeros7 { // #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum FromBytes1 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum FromBytes2 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(usize)] enum FromBytes3 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(isize)] enum FromBytes4 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum FromBytes5 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i32)] enum FromBytes6 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u64)] enum FromBytes7 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i64)] enum FromBytes8 { A, } #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum FooU8 { Variant0, @@ -454,78 +481,91 @@ enum FooU8 { // #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] enum Unaligned1 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u16)] enum Unaligned2 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i16)] enum Unaligned3 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum Unaligned4 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i32)] enum Unaligned5 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u64)] enum Unaligned6 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i64)] enum Unaligned7 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(usize)] enum Unaligned8 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(isize)] enum Unaligned9 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8, align(2))] enum Unaligned10 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(i8, align(2))] enum Unaligned11 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(1), align(2))] enum Unaligned12 { A, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(2), align(4))] enum Unaligned13 { A, @@ -536,6 +576,7 @@ enum Unaligned13 { // #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum IntoBytes1 { A, @@ -543,16 +584,19 @@ enum IntoBytes1 { } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(4))] struct Align4IntoBytes(u32); #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum IntoBytes2 { A(Align4IntoBytes), } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u32)] enum IntoBytes3 { A(u32), @@ -560,17 +604,20 @@ enum IntoBytes3 { } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum IntoBytes4 { A(u32), B(u16), } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] enum IntoBytes5 { A(u32), } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum IntoBytes6 { A(T), diff --git a/zerocopy-derive/tests/ui-nightly/enum.stderr b/zerocopy-derive/tests/ui-nightly/enum.stderr index b0894b5226..2ece01b011 100644 --- a/zerocopy-derive/tests/ui-nightly/enum.stderr +++ b/zerocopy-derive/tests/ui-nightly/enum.stderr @@ -1,301 +1,309 @@ error: unrecognized representation hint - --> tests/ui-nightly/enum.rs:19:8 + --> tests/ui-nightly/enum.rs:20:8 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^ error: unrecognized representation hint - --> tests/ui-nightly/enum.rs:25:8 + --> tests/ui-nightly/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:30:10 + --> tests/ui-nightly/enum.rs:32:10 | -30 | #[derive(FromBytes)] +32 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-nightly/enum.rs:37:8 + --> tests/ui-nightly/enum.rs:41:8 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^^^^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:42:10 + --> tests/ui-nightly/enum.rs:46:10 | -42 | #[derive(FromBytes)] +46 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:70:1 + --> tests/ui-nightly/enum.rs:78:1 | -70 | / enum TryFromBytes1 { -71 | | A, -72 | | } +78 | / #[zerocopy(crate = "zerocopy_renamed")] +79 | | enum TryFromBytes1 { +80 | | A, +81 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:75:1 + --> tests/ui-nightly/enum.rs:84:1 | -75 | / enum TryFromBytes2 { -76 | | A, -77 | | B(u8), -78 | | } +84 | / #[zerocopy(crate = "zerocopy_renamed")] +85 | | enum TryFromBytes2 { +86 | | A, +87 | | B(u8), +88 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:93:1 - | -93 | / enum FromZeros1 { -94 | | A(u8), -95 | | } - | |_^ + --> tests/ui-nightly/enum.rs:104:1 + | +104 | / #[zerocopy(crate = "zerocopy_renamed")] +105 | | enum FromZeros1 { +106 | | A(u8), +107 | | } + | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:98:1 - | - 98 | / enum FromZeros2 { - 99 | | A, -100 | | B(u8), -101 | | } + --> tests/ui-nightly/enum.rs:110:1 + | +110 | / #[zerocopy(crate = "zerocopy_renamed")] +111 | | enum FromZeros2 { +112 | | A, +113 | | B(u8), +114 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:104:1 + --> tests/ui-nightly/enum.rs:117:1 | -104 | / enum FromZeros3 { -105 | | A = 1, -106 | | B, -107 | | } +117 | / #[zerocopy(crate = "zerocopy_renamed")] +118 | | enum FromZeros3 { +119 | | A = 1, +120 | | B, +121 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-nightly/enum.rs:110:1 - | -110 | / #[repr(u8)] -111 | | enum FromZeros4 { -112 | | A = 1, -113 | | B = 2, -114 | | } + --> tests/ui-nightly/enum.rs:124:1 + | +124 | / #[zerocopy(crate = "zerocopy_renamed")] +125 | | #[repr(u8)] +126 | | enum FromZeros4 { +127 | | A = 1, +128 | | B = 2, +129 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` help: This enum has discriminants which are not literal integers. One of those may define or imply which variant has a discriminant of zero. Use a literal integer to define or imply the variant with a discriminant of zero. - --> tests/ui-nightly/enum.rs:119:1 + --> tests/ui-nightly/enum.rs:134:1 | -119 | / #[repr(i8)] -120 | | enum FromZeros5 { -121 | | A = NEGATIVE_ONE, -122 | | B, -123 | | } +134 | / #[zerocopy(crate = "zerocopy_renamed")] +135 | | #[repr(i8)] +136 | | enum FromZeros5 { +137 | | A = NEGATIVE_ONE, +138 | | B, +139 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-nightly/enum.rs:134:1 - | -134 | / #[repr(u8)] -135 | | enum FromZeros7 { -136 | | A = 1, -137 | | B(NotFromZeros), -138 | | } + --> tests/ui-nightly/enum.rs:151:1 + | +151 | / #[zerocopy(crate = "zerocopy_renamed")] +152 | | #[repr(u8)] +153 | | enum FromZeros7 { +154 | | A = 1, +155 | | B(NotFromZeros), +156 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:144:10 + --> tests/ui-nightly/enum.rs:162:10 | -144 | #[derive(FromBytes)] +162 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:150:8 + --> tests/ui-nightly/enum.rs:170:8 | -150 | #[repr(C)] +170 | #[repr(C)] | ^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:156:8 + --> tests/ui-nightly/enum.rs:177:8 | -156 | #[repr(usize)] +177 | #[repr(usize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:162:8 + --> tests/ui-nightly/enum.rs:184:8 | -162 | #[repr(isize)] +184 | #[repr(isize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:168:8 + --> tests/ui-nightly/enum.rs:191:8 | -168 | #[repr(u32)] +191 | #[repr(u32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:174:8 + --> tests/ui-nightly/enum.rs:198:8 | -174 | #[repr(i32)] +198 | #[repr(i32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:180:8 + --> tests/ui-nightly/enum.rs:205:8 | -180 | #[repr(u64)] +205 | #[repr(u64)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-nightly/enum.rs:186:8 + --> tests/ui-nightly/enum.rs:212:8 | -186 | #[repr(i64)] +212 | #[repr(i64)] | ^^^ error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:456:10 + --> tests/ui-nightly/enum.rs:483:10 | -456 | #[derive(Unaligned)] +483 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:462:10 + --> tests/ui-nightly/enum.rs:490:10 | -462 | #[derive(Unaligned)] +490 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:468:10 + --> tests/ui-nightly/enum.rs:497:10 | -468 | #[derive(Unaligned)] +497 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:474:10 + --> tests/ui-nightly/enum.rs:504:10 | -474 | #[derive(Unaligned)] +504 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:480:10 + --> tests/ui-nightly/enum.rs:511:10 | -480 | #[derive(Unaligned)] +511 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:486:10 + --> tests/ui-nightly/enum.rs:518:10 | -486 | #[derive(Unaligned)] +518 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:492:10 + --> tests/ui-nightly/enum.rs:525:10 | -492 | #[derive(Unaligned)] +525 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:498:10 + --> tests/ui-nightly/enum.rs:532:10 | -498 | #[derive(Unaligned)] +532 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/enum.rs:504:10 + --> tests/ui-nightly/enum.rs:539:10 | -504 | #[derive(Unaligned)] +539 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-nightly/enum.rs:511:12 + --> tests/ui-nightly/enum.rs:548:12 | -511 | #[repr(u8, align(2))] +548 | #[repr(u8, align(2))] | ^^^^^^^^ error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-nightly/enum.rs:517:12 + --> tests/ui-nightly/enum.rs:555:12 | -517 | #[repr(i8, align(2))] +555 | #[repr(i8, align(2))] | ^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/enum.rs:523:8 + --> tests/ui-nightly/enum.rs:562:8 | -523 | #[repr(align(1), align(2))] +562 | #[repr(align(1), align(2))] | ^^^^^^^^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/enum.rs:529:8 + --> tests/ui-nightly/enum.rs:569:8 | -529 | #[repr(align(2), align(4))] +569 | #[repr(align(2), align(4))] | ^^^^^^^^^^^^^^^^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:562:10 + --> tests/ui-nightly/enum.rs:606:10 | -562 | #[derive(IntoBytes)] +606 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/enum.rs:568:10 + --> tests/ui-nightly/enum.rs:613:10 | -568 | #[derive(IntoBytes)] +613 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: generic parameters may not be used in const operations - --> tests/ui-nightly/enum.rs:576:7 + --> tests/ui-nightly/enum.rs:623:7 | -576 | A(T), +623 | A(T), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0565]: meta item in `repr` must be an identifier - --> tests/ui-nightly/enum.rs:19:1 + --> tests/ui-nightly/enum.rs:20:1 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^^^^^^^^^^ error[E0552]: unrecognized representation hint - --> tests/ui-nightly/enum.rs:25:8 + --> tests/ui-nightly/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` = note: for more information, visit error[E0566]: conflicting representation hints - --> tests/ui-nightly/enum.rs:37:8 + --> tests/ui-nightly/enum.rs:41:8 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^ ^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -303,9 +311,9 @@ error[E0566]: conflicting representation hints = note: `#[deny(conflicting_repr_hints)]` (part of `#[deny(future_incompatible)]`) on by default error[E0277]: the trait bound `UnsafeCell<()>: Immutable` is not satisfied - --> tests/ui-nightly/enum.rs:51:10 + --> tests/ui-nightly/enum.rs:56:10 | -51 | #[derive(Immutable)] +56 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` @@ -327,9 +335,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `UnsafeCell: Immutable` is not satisfied - --> tests/ui-nightly/enum.rs:59:10 + --> tests/ui-nightly/enum.rs:66:10 | -59 | #[derive(Immutable)] +66 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell` @@ -351,15 +359,15 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `NotTryFromBytes: TryFromBytes` is not satisfied - --> tests/ui-nightly/enum.rs:82:10 + --> tests/ui-nightly/enum.rs:92:10 | -82 | #[derive(TryFromBytes)] +92 | #[derive(TryFromBytes)] | ^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `TryFromBytes` is not implemented for `NotTryFromBytes` - --> tests/ui-nightly/enum.rs:80:1 + --> tests/ui-nightly/enum.rs:90:1 | -80 | struct NotTryFromBytes; +90 | struct NotTryFromBytes; | ^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotTryFromBytes` = help: the following other types implement trait `TryFromBytes`: @@ -380,15 +388,15 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `NotFromZeros: TryFromBytes` is not satisfied - --> tests/ui-nightly/enum.rs:127:10 + --> tests/ui-nightly/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `TryFromBytes` is not implemented for `NotFromZeros` - --> tests/ui-nightly/enum.rs:125:1 + --> tests/ui-nightly/enum.rs:141:1 | -125 | struct NotFromZeros; +141 | struct NotFromZeros; | ^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotFromZeros` = help: the following other types implement trait `TryFromBytes`: @@ -409,15 +417,15 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `NotFromZeros: FromZeros` is not satisfied - --> tests/ui-nightly/enum.rs:127:10 + --> tests/ui-nightly/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotFromZeros` - --> tests/ui-nightly/enum.rs:125:1 + --> tests/ui-nightly/enum.rs:141:1 | -125 | struct NotFromZeros; +141 | struct NotFromZeros; | ^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromZeros)]` to `NotFromZeros` = help: the following other types implement trait `FromZeros`: @@ -438,9 +446,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `bool: FromBytes` is not satisfied - --> tests/ui-nightly/enum.rs:191:10 + --> tests/ui-nightly/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromBytes` is not implemented for `bool` | = note: Consider adding `#[derive(FromBytes)]` to `bool` @@ -462,9 +470,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes1` has 1 total byte(s) of padding - --> tests/ui-nightly/enum.rs:538:10 + --> tests/ui-nightly/enum.rs:578:10 | -538 | #[derive(IntoBytes)] +578 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -484,9 +492,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes2` has 3 total byte(s) of padding - --> tests/ui-nightly/enum.rs:549:10 + --> tests/ui-nightly/enum.rs:591:10 | -549 | #[derive(IntoBytes)] +591 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -506,9 +514,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes3` has 2 total byte(s) of padding - --> tests/ui-nightly/enum.rs:555:10 + --> tests/ui-nightly/enum.rs:598:10 | -555 | #[derive(IntoBytes)] +598 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -528,22 +536,22 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error: generic `Self` types are currently not permitted in anonymous constants - --> tests/ui-nightly/enum.rs:573:10 + --> tests/ui-nightly/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ | note: not a concrete type - --> tests/ui-nightly/enum.rs:573:10 + --> tests/ui-nightly/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `bool: FromBytes` is not satisfied - --> tests/ui-nightly/enum.rs:191:10 + --> tests/ui-nightly/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromBytes` is not implemented for `bool` | = note: Consider adding `#[derive(FromBytes)]` to `bool` @@ -558,13 +566,13 @@ error[E0277]: the trait bound `bool: FromBytes` is not satisfied (A, B, C, D, E, F, G, H) and $N others note: required for `FooU8` to implement `FromBytes` - --> tests/ui-nightly/enum.rs:191:10 + --> tests/ui-nightly/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_is_from_bytes` - --> tests/ui-nightly/enum.rs:191:10 + --> tests/ui-nightly/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ required by this bound in `assert_is_from_bytes` = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs b/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs index 1b1bed31f3..64db234006 100644 --- a/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs +++ b/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs @@ -7,11 +7,12 @@ // those terms. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; fn main() {} #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum Foo { Variant0, diff --git a/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr b/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr index 947c9d0571..36b4d85da7 100644 --- a/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr +++ b/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr @@ -1,11 +1,11 @@ error: FromBytes only supported on repr(u8) enum with 256 variants --> tests/ui-nightly/enum_from_bytes_u8_too_few.rs:15:1 | - 15 | / #[repr(u8)] - 16 | | enum Foo { - 17 | | Variant0, - 18 | | Variant1, + 15 | / #[zerocopy(crate = "zerocopy_renamed")] + 16 | | #[repr(u8)] + 17 | | enum Foo { + 18 | | Variant0, ... | -271 | | Variant254, -272 | | } +272 | | Variant254, +273 | | } | |_^ diff --git a/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs b/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs index d8aeb36943..ace855f9d1 100644 --- a/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs +++ b/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs @@ -7,12 +7,12 @@ // those terms. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; #[path = "../include.rs"] mod util; -use zerocopy::KnownLayout; +use zerocopy_renamed::KnownLayout; use self::util::util::{NotZerocopy, AU16}; @@ -27,6 +27,7 @@ fn main() {} // #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct TryFromBytes1 { value: NotZerocopy, } @@ -36,6 +37,7 @@ struct TryFromBytes1 { // #[derive(FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] struct FromZeros1 { value: NotZerocopy, } @@ -45,6 +47,7 @@ struct FromZeros1 { // #[derive(FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct FromBytes1 { value: NotZerocopy, } @@ -54,6 +57,7 @@ struct FromBytes1 { // #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes1 { value: NotZerocopy, @@ -64,6 +68,7 @@ struct IntoBytes1 { // #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Unaligned1 { aligned: AU16, @@ -72,6 +77,7 @@ struct Unaligned1 { // This specifically tests a bug we had in an old version of the code in which // the trait bound would only be enforced for the first field's type. #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct Unaligned2 { unaligned: u8, @@ -79,6 +85,7 @@ struct Unaligned2 { } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent)] struct Unaligned3 { aligned: AU16, diff --git a/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr b/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr index ace5bad366..0512a443e3 100644 --- a/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr @@ -1,24 +1,24 @@ -warning: unused import: `zerocopy::KnownLayout` +warning: unused import: `zerocopy_renamed::KnownLayout` --> tests/ui-nightly/late_compile_pass.rs:15:5 | -15 | use zerocopy::KnownLayout; - | ^^^^^^^^^^^^^^^^^^^^^ +15 | use zerocopy_renamed::KnownLayout; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:29:10 | 29 | #[derive(TryFromBytes)] | ^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -35,19 +35,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:38:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] +39 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -65,9 +65,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:38:10 + --> tests/ui-nightly/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] +39 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -93,19 +93,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -123,9 +123,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:47:10 + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -151,19 +151,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -180,19 +180,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:56:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:59:10 | -56 | #[derive(IntoBytes)] +59 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `zerocopy_renamed::IntoBytes`: () AU16 AtomicBool @@ -209,19 +209,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:66:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:70:10 | -66 | #[derive(Unaligned)] +70 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-nightly/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -238,19 +238,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:74:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:79:10 | -74 | #[derive(Unaligned)] +79 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-nightly/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -267,19 +267,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:81:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:87:10 | -81 | #[derive(Unaligned)] +87 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-nightly/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -296,19 +296,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-nightly/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-nightly/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -318,14 +318,14 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `FromBytes1` to implement `zerocopy::FromBytes` - --> tests/ui-nightly/late_compile_pass.rs:47:10 +note: required for `FromBytes1` to implement `zerocopy_renamed::FromBytes` + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro -note: required by a bound in `_::_::::is_bit_valid::assert_is_from_bytes` - --> tests/ui-nightly/late_compile_pass.rs:47:10 +note: required by a bound in `_::_::::is_bit_valid::assert_is_from_bytes` + --> tests/ui-nightly/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ required by this bound in `assert_is_from_bytes` = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs index e0c4bc578d..db01fd2b38 100644 --- a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs +++ b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs @@ -6,9 +6,9 @@ // This file may not be copied, modified, or distributed except according to // those terms. -extern crate zerocopy; +extern crate zerocopy_renamed; -use zerocopy::KnownLayout; +use zerocopy_renamed::KnownLayout; fn main() {} @@ -25,6 +25,7 @@ fn assert_kl(_: &T) {} // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | Y | N | N | KL04 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct KL04(u8, T); fn test_kl04(kl: &KL04) { @@ -34,6 +35,7 @@ fn test_kl04(kl: &KL04) { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | Y | Y | N | KL06 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct KL06(u8, T); fn test_kl06(kl: &KL06) { @@ -43,6 +45,7 @@ fn test_kl06(kl: &KL06) { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | Y | Y | N | N | KL12 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct KL12(u8, T); @@ -53,6 +56,7 @@ fn test_kl12(kl: &KL12) { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | Y | Y | N | Y | KL13 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct KL13(u8, T); diff --git a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr index deb1301621..40c5e1d7cf 100644 --- a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr @@ -1,37 +1,37 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied - --> tests/ui-nightly/mid_compile_pass.rs:59:26 + --> tests/ui-nightly/mid_compile_pass.rs:63:26 | -59 | fn test_kl13(t: T) -> impl KnownLayout { +63 | fn test_kl13(t: T) -> impl KnownLayout { | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T` -60 | KL13(0u8, t) +64 | KL13(0u8, t) | ------------ return type was inferred to be `KL13` here | = note: Consider adding `#[derive(KnownLayout)]` to `T` note: required for `KL13` to implement `KnownLayout` - --> tests/ui-nightly/mid_compile_pass.rs:55:10 + --> tests/ui-nightly/mid_compile_pass.rs:58:10 | -55 | #[derive(KnownLayout)] +58 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `KnownLayout` | -59 | fn test_kl13(t: T) -> impl KnownLayout { - | +++++++++++++++++++++++ +63 | fn test_kl13(t: T) -> impl KnownLayout { + | +++++++++++++++++++++++++++++++ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-nightly/mid_compile_pass.rs:31:15 + --> tests/ui-nightly/mid_compile_pass.rs:32:15 | -30 | fn test_kl04(kl: &KL04) { +31 | fn test_kl04(kl: &KL04) { | - this type parameter needs to be `Sized` -31 | assert_kl(kl); +32 | assert_kl(kl); | --------- ^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call | note: required because it appears within the type `KL04` - --> tests/ui-nightly/mid_compile_pass.rs:28:8 + --> tests/ui-nightly/mid_compile_pass.rs:29:8 | -28 | struct KL04(u8, T); +29 | struct KL04(u8, T); | ^^^^ note: required for `KL04` to implement `KnownLayout` --> tests/ui-nightly/mid_compile_pass.rs:27:10 @@ -46,29 +46,29 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -30 - fn test_kl04(kl: &KL04) { -30 + fn test_kl04(kl: &KL04) { +31 - fn test_kl04(kl: &KL04) { +31 + fn test_kl04(kl: &KL04) { | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-nightly/mid_compile_pass.rs:40:15 + --> tests/ui-nightly/mid_compile_pass.rs:42:15 | -39 | fn test_kl06(kl: &KL06) { +41 | fn test_kl06(kl: &KL06) { | - this type parameter needs to be `Sized` -40 | assert_kl(kl); +42 | assert_kl(kl); | --------- ^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call | note: required because it appears within the type `KL06` - --> tests/ui-nightly/mid_compile_pass.rs:37:8 + --> tests/ui-nightly/mid_compile_pass.rs:39:8 | -37 | struct KL06(u8, T); +39 | struct KL06(u8, T); | ^^^^ note: required for `KL06` to implement `KnownLayout` - --> tests/ui-nightly/mid_compile_pass.rs:36:10 + --> tests/ui-nightly/mid_compile_pass.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_kl` --> tests/ui-nightly/mid_compile_pass.rs:23:26 @@ -78,22 +78,22 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -39 - fn test_kl06(kl: &KL06) { -39 + fn test_kl06(kl: &KL06) { +41 - fn test_kl06(kl: &KL06) { +41 + fn test_kl06(kl: &KL06) { | error[E0277]: the trait bound `KL12: KnownLayout` is not satisfied - --> tests/ui-nightly/mid_compile_pass.rs:50:15 + --> tests/ui-nightly/mid_compile_pass.rs:53:15 | -50 | assert_kl(kl) +53 | assert_kl(kl) | --------- ^^ the trait `KnownLayout` is not implemented for `KL12` | | | required by a bound introduced by this call | note: required for `KL12` to implement `KnownLayout` - --> tests/ui-nightly/mid_compile_pass.rs:45:10 + --> tests/ui-nightly/mid_compile_pass.rs:47:10 | -45 | #[derive(KnownLayout)] +47 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_kl` --> tests/ui-nightly/mid_compile_pass.rs:23:26 @@ -103,7 +103,7 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider borrowing here | -50 | assert_kl(&kl) +53 | assert_kl(&kl) | + -50 | assert_kl(&mut kl) +53 | assert_kl(&mut kl) | ++++ diff --git a/zerocopy-derive/tests/ui-nightly/privacy.rs b/zerocopy-derive/tests/ui-nightly/privacy.rs index 2ba3304fa0..83f6c415eb 100644 --- a/zerocopy-derive/tests/ui-nightly/privacy.rs +++ b/zerocopy-derive/tests/ui-nightly/privacy.rs @@ -9,7 +9,7 @@ #![allow(unused_braces)] #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; fn main() {} @@ -19,36 +19,56 @@ fn main() {} mod private { #[derive(TryFromBytes)] + #[zerocopy(crate = "zerocopy_renamed")] pub struct StructWithNamedFields { pub a: u8, pub(self) b: u16, } const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; }; #[derive(TryFromBytes)] + #[zerocopy(crate = "zerocopy_renamed")] pub struct StructWithAnonFields(pub u8, pub(self) u16); const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; }; #[derive(TryFromBytes)] + #[zerocopy(crate = "zerocopy_renamed")] pub struct Union { pub a: u8, pub(self) b: u16, } const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; }; #[derive(TryFromBytes)] + #[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] pub enum Enum { A(u8, u16), @@ -56,14 +76,14 @@ mod private { } const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; - let _: >::Type = 0u8; - let _: >::Type = 0u8; + let _: >::Type = 0u16; }; } @@ -71,32 +91,49 @@ mod private { use private::*; const _: () = { - let _: >::Type = - 0u8; - let _: >::Type = - 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; }; const _: () = { - let _: >::Type = - 0u8; - let _: >::Type = - 0u16; + let _: >::Type = 0u8; + let _: >::Type = 0u16; }; const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = + 0u8; + let _: >::Type = + 0u16; }; const _: () = { - let _: >::Type = 0u8; - let _: >::Type = 0u16; + let _: >::Type = + 0u8; + let _: >::Type = + 0u16; - let _: >::Type = 0u8; - let _: >::Type = + 0u8; + let _: >::Type = 0u16; }; diff --git a/zerocopy-derive/tests/ui-nightly/privacy.stderr b/zerocopy-derive/tests/ui-nightly/privacy.stderr index eeb765f902..43aecbdd84 100644 --- a/zerocopy-derive/tests/ui-nightly/privacy.stderr +++ b/zerocopy-derive/tests/ui-nightly/privacy.stderr @@ -1,17 +1,17 @@ error: type `private::_::_::_::ẕb` is private - --> tests/ui-nightly/privacy.rs:76:57 - | -76 | let _: >::Type = - | ^ private type + --> tests/ui-nightly/privacy.rs:100:9 + | +100 | _, + | ^ private type error: type `private::_::_::_::ẕ1` is private - --> tests/ui-nightly/privacy.rs:83:56 - | -83 | let _: >::Type = - | ^ private type + --> tests/ui-nightly/privacy.rs:113:9 + | +113 | _, + | ^ private type error: type `private::_::_::_::ẕb` is private - --> tests/ui-nightly/privacy.rs:89:41 - | -89 | let _: >::Type = 0u16; - | ^ private type + --> tests/ui-nightly/privacy.rs:122:49 + | +122 | let _: >::Type = + | ^ private type diff --git a/zerocopy-derive/tests/ui-nightly/struct.rs b/zerocopy-derive/tests/ui-nightly/struct.rs index 54a26b2918..9911cba843 100644 --- a/zerocopy-derive/tests/ui-nightly/struct.rs +++ b/zerocopy-derive/tests/ui-nightly/struct.rs @@ -7,12 +7,12 @@ // those terms. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; #[path = "../include.rs"] mod util; -use zerocopy::{IntoBytes, KnownLayout}; +use zerocopy_renamed::{IntoBytes, KnownLayout}; use self::util::util::AU16; @@ -29,22 +29,26 @@ struct NotKnownLayoutDst([u8]); // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | N | N | N | KL00 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct KL00(u8, NotKnownLayoutDst); // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | N | Y | N | KL02 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] struct KL02(u8, [u8]); // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | Y | N | N | N | KL08 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct KL08(u8, NotKnownLayoutDst); // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | Y | N | N | Y | KL09 | #[derive(KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct KL09(NotKnownLayout, NotKnownLayout); @@ -53,11 +57,13 @@ struct KL09(NotKnownLayout, NotKnownLayout); // #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Immutable1 { a: core::cell::UnsafeCell<()>, } #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct Immutable2 { a: [core::cell::UnsafeCell; 0], } @@ -67,24 +73,28 @@ struct Immutable2 { // #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed)] struct TryFromBytesPacked { foo: AU16, } #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed(1))] struct TryFromBytesPackedN { foo: AU16, } #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] struct TryFromBytesCPacked { foo: AU16, } #[derive(TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(1))] struct TryFromBytesCPackedN { foo: AU16, @@ -98,6 +108,7 @@ struct TryFromBytesCPackedN { // emitted in which each field type is given an `Unaligned` bound. Since `foo`'s // type doesn't implement `Unaligned`, this should fail. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes1 { foo: AU16, @@ -105,6 +116,7 @@ struct IntoBytes1 { } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes2 { foo: u8, @@ -112,6 +124,7 @@ struct IntoBytes2 { } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(2))] struct IntoBytes3 { foo: u8, @@ -128,6 +141,7 @@ type SliceU8 = [u8]; // NOTE(#1708): This exists to ensure that our error messages are good when a // field is unsized. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes4 { a: u8, @@ -137,6 +151,7 @@ struct IntoBytes4 { // Padding between `u8` and `[u16]`. `[u16]` is syntactically identifiable as a // slice, so this case is handled by our `repr(C)` slice DST support. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes5 { a: u8, @@ -146,6 +161,7 @@ struct IntoBytes5 { // Trailing padding after `[u8]`. `[u8]` is syntactically identifiable as a // slice, so this case is handled by our `repr(C)` slice DST support. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes6 { a: u16, @@ -156,6 +172,7 @@ struct IntoBytes6 { // is syntactically identifiable as a slice, so this case is handled by our // `repr(C)` slice DST support. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct IntoBytes7 { a: u8, @@ -164,17 +181,20 @@ struct IntoBytes7 { } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs struct IntoBytes8 { a: u8, } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] struct IntoBytes9 { t: T, } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed(2))] struct IntoBytes10 { t: T, @@ -182,6 +202,7 @@ struct IntoBytes10 { // `repr(C, packed(2))` is not equivalent to `repr(C, packed)`. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(2))] struct IntoBytes11 { t0: T, @@ -198,6 +219,7 @@ fn is_into_bytes_11() { // `repr(C, align(2))` is not sufficient to guarantee the layout of this type. #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(2))] struct IntoBytes12 { t: T, @@ -208,31 +230,38 @@ struct IntoBytes12 { // #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(2))] struct Unaligned1; #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(transparent, align(2))] struct Unaligned2 { foo: u8, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed, align(2))] struct Unaligned3; #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(1), align(2))] struct Unaligned4; #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(2), align(4))] struct Unaligned5; #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] struct Unaligned6; #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed(2))] struct Unaligned7; @@ -242,13 +271,16 @@ struct Unaligned7; #[derive(Copy, Clone)] #[repr(packed(2), C)] #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed(2))] struct WeirdReprSpan; #[derive(SplitAt)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct SplitAtNotKnownLayout([u8]); #[derive(SplitAt, KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct SplitAtSized(u8); diff --git a/zerocopy-derive/tests/ui-nightly/struct.stderr b/zerocopy-derive/tests/ui-nightly/struct.stderr index f91648fca8..688f0b3481 100644 --- a/zerocopy-derive/tests/ui-nightly/struct.stderr +++ b/zerocopy-derive/tests/ui-nightly/struct.stderr @@ -1,92 +1,93 @@ error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:167:8 + --> tests/ui-nightly/struct.rs:185:8 | -167 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs +185 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs | ^^^^ error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/struct.rs:172:10 + --> tests/ui-nightly/struct.rs:190:10 | -172 | #[derive(IntoBytes)] +190 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/struct.rs:177:10 + --> tests/ui-nightly/struct.rs:196:10 | -177 | #[derive(IntoBytes)] +196 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-nightly/struct.rs:200:10 + --> tests/ui-nightly/struct.rs:221:10 | -200 | #[derive(IntoBytes)] +221 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-nightly/struct.rs:211:11 + --> tests/ui-nightly/struct.rs:234:11 | -211 | #[repr(C, align(2))] +234 | #[repr(C, align(2))] | ^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:215:8 + --> tests/ui-nightly/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:221:8 + --> tests/ui-nightly/struct.rs:246:8 | -221 | #[repr(packed, align(2))] +246 | #[repr(packed, align(2))] | ^^^^^^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:225:8 + --> tests/ui-nightly/struct.rs:251:8 | -225 | #[repr(align(1), align(2))] +251 | #[repr(align(1), align(2))] | ^^^^^^^^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:229:8 + --> tests/ui-nightly/struct.rs:256:8 | -229 | #[repr(align(2), align(4))] +256 | #[repr(align(2), align(4))] | ^^^^^^^^^^^^^^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/struct.rs:232:10 + --> tests/ui-nightly/struct.rs:259:10 | -232 | #[derive(Unaligned)] +259 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/struct.rs:235:10 + --> tests/ui-nightly/struct.rs:263:10 | -235 | #[derive(Unaligned)] +263 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-nightly/struct.rs:243:19 + --> tests/ui-nightly/struct.rs:272:19 | -243 | #[repr(packed(2), C)] +272 | #[repr(packed(2), C)] | ___________________^ -244 | | #[derive(Unaligned)] -245 | | #[repr(C, packed(2))] +273 | | #[derive(Unaligned)] +274 | | #[zerocopy(crate = "zerocopy_renamed")] +275 | | #[repr(C, packed(2))] | |________^ error[E0692]: transparent struct cannot have other repr hints - --> tests/ui-nightly/struct.rs:215:8 + --> tests/ui-nightly/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ ^^^^^^^^ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time @@ -97,9 +98,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL00` - --> tests/ui-nightly/struct.rs:32:8 + --> tests/ui-nightly/struct.rs:33:8 | -32 | struct KL00(u8, NotKnownLayoutDst); +33 | struct KL00(u8, NotKnownLayoutDst); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -109,16 +110,16 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-nightly/struct.rs:36:10 + --> tests/ui-nightly/struct.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL02` - --> tests/ui-nightly/struct.rs:37:8 + --> tests/ui-nightly/struct.rs:39:8 | -37 | struct KL02(u8, [u8]); +39 | struct KL02(u8, [u8]); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -127,19 +128,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy::KnownLayout` is not satisfied - --> tests/ui-nightly/struct.rs:41:10 +error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-nightly/struct.rs:43:10 | -41 | #[derive(KnownLayout)] +43 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayoutDst` +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayoutDst` --> tests/ui-nightly/struct.rs:27:1 | 27 | struct NotKnownLayoutDst([u8]); | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayoutDst` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -156,19 +157,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `NotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-nightly/struct.rs:47:10 +error[E0277]: the trait bound `NotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-nightly/struct.rs:50:10 | -47 | #[derive(KnownLayout)] +50 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayout` +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayout` --> tests/ui-nightly/struct.rs:25:1 | 25 | struct NotKnownLayout; | ^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayout` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -185,14 +186,14 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/struct.rs:55:10 +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-nightly/struct.rs:59:10 | -55 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` +59 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -209,14 +210,14 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `UnsafeCell: zerocopy::Immutable` is not satisfied - --> tests/ui-nightly/struct.rs:60:10 +error[E0277]: the trait bound `UnsafeCell: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-nightly/struct.rs:65:10 | -60 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell` +65 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -226,7 +227,7 @@ error[E0277]: the trait bound `UnsafeCell: zerocopy::Immutable` is not satis (A, B, C, D, E) (A, B, C, D, E, F) and $N others - = note: required for `[UnsafeCell; 0]` to implement `zerocopy::Immutable` + = note: required for `[UnsafeCell; 0]` to implement `zerocopy_renamed::Immutable` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) help: add `#![feature(trivial_bounds)]` to the crate attributes to enable @@ -235,9 +236,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-nightly/struct.rs:71:1 + --> tests/ui-nightly/struct.rs:78:1 | -71 | struct TryFromBytesPacked { +78 | struct TryFromBytesPacked { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -247,9 +248,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-nightly/struct.rs:77:1 + --> tests/ui-nightly/struct.rs:85:1 | -77 | struct TryFromBytesPackedN { +85 | struct TryFromBytesPackedN { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -259,9 +260,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-nightly/struct.rs:83:1 + --> tests/ui-nightly/struct.rs:92:1 | -83 | struct TryFromBytesCPacked { +92 | struct TryFromBytesCPacked { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -271,9 +272,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-nightly/struct.rs:89:1 + --> tests/ui-nightly/struct.rs:99:1 | -89 | struct TryFromBytesCPackedN { +99 | struct TryFromBytesCPackedN { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -282,19 +283,19 @@ note: `AU16` has a `#[repr(align)]` attribute | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/struct.rs:100:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/struct.rs:110:10 | -100 | #[derive(IntoBytes)] +110 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-nightly/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -312,9 +313,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes2` has 1 total byte(s) of padding - --> tests/ui-nightly/struct.rs:107:10 + --> tests/ui-nightly/struct.rs:118:10 | -107 | #[derive(IntoBytes)] +118 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -334,9 +335,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes3` has 1 total byte(s) of padding - --> tests/ui-nightly/struct.rs:114:10 + --> tests/ui-nightly/struct.rs:126:10 | -114 | #[derive(IntoBytes)] +126 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -356,16 +357,16 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-nightly/struct.rs:130:10 + --> tests/ui-nightly/struct.rs:143:10 | -130 | #[derive(IntoBytes)] +143 | #[derive(IntoBytes)] | ^^^^^^^^^ doesn't have a size known at compile-time | = help: within `IntoBytes4`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `IntoBytes4` - --> tests/ui-nightly/struct.rs:132:8 + --> tests/ui-nightly/struct.rs:146:8 | -132 | struct IntoBytes4 { +146 | struct IntoBytes4 { | ^^^^^^^^^^ = note: required for `IntoBytes4` to implement `macro_util::__size_of::Sized` note: required by a bound in `macro_util::__size_of::size_of` @@ -376,9 +377,9 @@ note: required by a bound in `macro_util::__size_of::size_of` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `[u8]` is unsized - --> tests/ui-nightly/struct.rs:134:8 + --> tests/ui-nightly/struct.rs:148:8 | -134 | b: SliceU8, +148 | b: SliceU8, | ^^^^^^^ `IntoBytes` needs all field types to be `Sized` in order to determine whether there is padding | = help: the trait `Sized` is not implemented for `[u8]` @@ -392,9 +393,9 @@ note: required by a bound in `macro_util::__size_of::size_of` | ^^^^^ required by this bound in `size_of` error[E0277]: `IntoBytes5` has one or more padding bytes - --> tests/ui-nightly/struct.rs:139:10 + --> tests/ui-nightly/struct.rs:153:10 | -139 | #[derive(IntoBytes)] +153 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -414,9 +415,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes6` has one or more padding bytes - --> tests/ui-nightly/struct.rs:148:10 + --> tests/ui-nightly/struct.rs:163:10 | -148 | #[derive(IntoBytes)] +163 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -436,9 +437,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes7` has one or more padding bytes - --> tests/ui-nightly/struct.rs:158:10 + --> tests/ui-nightly/struct.rs:174:10 | -158 | #[derive(IntoBytes)] +174 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -458,24 +459,24 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0587]: type has conflicting packed and align representation hints - --> tests/ui-nightly/struct.rs:222:1 + --> tests/ui-nightly/struct.rs:247:1 | -222 | struct Unaligned3; +247 | struct Unaligned3; | ^^^^^^^^^^^^^^^^^ -error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-nightly/struct.rs:248:10 +error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-nightly/struct.rs:278:10 | -248 | #[derive(SplitAt)] +278 | #[derive(SplitAt)] | ^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `SplitAtNotKnownLayout` - --> tests/ui-nightly/struct.rs:250:1 +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `SplitAtNotKnownLayout` + --> tests/ui-nightly/struct.rs:281:1 | -250 | struct SplitAtNotKnownLayout([u8]); +281 | struct SplitAtNotKnownLayout([u8]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `SplitAtNotKnownLayout` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -493,19 +494,19 @@ note: required by a bound in `SplitAt` = note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `u8: SplitAt` is not satisfied - --> tests/ui-nightly/struct.rs:252:10 + --> tests/ui-nightly/struct.rs:283:10 | -252 | #[derive(SplitAt, KnownLayout)] +283 | #[derive(SplitAt, KnownLayout)] | ^^^^^^^ the trait `SplitAt` is not implemented for `u8` | = note: Consider adding `#[derive(SplitAt)]` to `u8` help: the following other types implement trait `SplitAt` - --> tests/ui-nightly/struct.rs:248:10 + --> tests/ui-nightly/struct.rs:278:10 | -248 | #[derive(SplitAt)] +278 | #[derive(SplitAt)] | ^^^^^^^ `SplitAtNotKnownLayout` ... -252 | #[derive(SplitAt, KnownLayout)] +283 | #[derive(SplitAt, KnownLayout)] | ^^^^^^^ `SplitAtSized` | ::: $WORKSPACE/src/split_at.rs @@ -519,19 +520,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 9 + #![feature(trivial_bounds)] | -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-nightly/struct.rs:195:28 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-nightly/struct.rs:216:28 | -195 | is_into_bytes_11::>(); +216 | is_into_bytes_11::>(); | ^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-nightly/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -541,14 +542,14 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` F64 I128 and $N others -note: required for `IntoBytes11` to implement `zerocopy::IntoBytes` - --> tests/ui-nightly/struct.rs:184:10 +note: required for `IntoBytes11` to implement `zerocopy_renamed::IntoBytes` + --> tests/ui-nightly/struct.rs:204:10 | -184 | #[derive(IntoBytes)] +204 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `is_into_bytes_11` - --> tests/ui-nightly/struct.rs:193:24 + --> tests/ui-nightly/struct.rs:214:24 | -193 | fn is_into_bytes_11() { +214 | fn is_into_bytes_11() { | ^^^^^^^^^ required by this bound in `is_into_bytes_11` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-nightly/union.rs b/zerocopy-derive/tests/ui-nightly/union.rs index f6eeee2a92..14e018a46d 100644 --- a/zerocopy-derive/tests/ui-nightly/union.rs +++ b/zerocopy-derive/tests/ui-nightly/union.rs @@ -7,7 +7,7 @@ // those terms. #[macro_use] -extern crate zerocopy; +extern crate zerocopy_renamed; #[path = "../include.rs"] mod util; @@ -23,6 +23,7 @@ fn main() {} // #[derive(Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] union Immutable1 { a: ManuallyDrop>, } @@ -32,12 +33,14 @@ union Immutable1 { // #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union IntoBytes1 { foo: ManuallyDrop, } #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union IntoBytes2 { foo: u8, @@ -46,12 +49,14 @@ union IntoBytes2 { // Need a `repr` attribute #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union IntoBytes3 { foo: u8, } // `repr(packed(2))` isn't equivalent to `repr(packed)` #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed(2))] union IntoBytes4 { foo: u8, @@ -62,6 +67,7 @@ union IntoBytes4 { // #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(2))] union Unaligned1 { foo: i16, @@ -78,30 +84,35 @@ union Unaligned1 { // } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed, align(2))] union Unaligned3 { foo: u8, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(1), align(2))] struct Unaligned4 { foo: u8, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(align(2), align(4))] struct Unaligned5 { foo: u8, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] union Unaligned6 { foo: i16, bar: AU16, } #[derive(Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed(2))] union Unaligned7 { foo: i16, diff --git a/zerocopy-derive/tests/ui-nightly/union.stderr b/zerocopy-derive/tests/ui-nightly/union.stderr index 8073858e9e..bf167cbc86 100644 --- a/zerocopy-derive/tests/ui-nightly/union.stderr +++ b/zerocopy-derive/tests/ui-nightly/union.stderr @@ -1,71 +1,71 @@ error: unsupported on types with type parameters - --> tests/ui-nightly/union.rs:34:10 + --> tests/ui-nightly/union.rs:35:10 | -34 | #[derive(IntoBytes)] +35 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-nightly/union.rs:48:10 + --> tests/ui-nightly/union.rs:51:10 | -48 | #[derive(IntoBytes)] +51 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-nightly/union.rs:54:10 + --> tests/ui-nightly/union.rs:58:10 | -54 | #[derive(IntoBytes)] +58 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-nightly/union.rs:65:11 + --> tests/ui-nightly/union.rs:71:11 | -65 | #[repr(C, align(2))] +71 | #[repr(C, align(2))] | ^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/union.rs:81:8 + --> tests/ui-nightly/union.rs:88:8 | -81 | #[repr(packed, align(2))] +88 | #[repr(packed, align(2))] | ^^^^^^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/union.rs:87:8 + --> tests/ui-nightly/union.rs:95:8 | -87 | #[repr(align(1), align(2))] +95 | #[repr(align(1), align(2))] | ^^^^^^^^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-nightly/union.rs:93:8 - | -93 | #[repr(align(2), align(4))] - | ^^^^^^^^^^^^^^^^^^ + --> tests/ui-nightly/union.rs:102:8 + | +102 | #[repr(align(2), align(4))] + | ^^^^^^^^^^^^^^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/union.rs:98:10 - | -98 | #[derive(Unaligned)] - | ^^^^^^^^^ - | - = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui-nightly/union.rs:107:10 + | +107 | #[derive(Unaligned)] + | ^^^^^^^^^ + | + = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-nightly/union.rs:104:10 + --> tests/ui-nightly/union.rs:114:10 | -104 | #[derive(Unaligned)] +114 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) warning: unexpected `cfg` condition name: `zerocopy_derive_union_into_bytes` - --> tests/ui-nightly/union.rs:40:10 + --> tests/ui-nightly/union.rs:42:10 | -40 | #[derive(IntoBytes)] +42 | #[derive(IntoBytes)] | ^^^^^^^^^ | = help: expected names are: `docsrs`, `feature`, and `test` and 31 more @@ -76,14 +76,14 @@ warning: unexpected `cfg` condition name: `zerocopy_derive_union_into_bytes` = note: `#[warn(unexpected_cfgs)]` on by default = note: this warning originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied --> tests/ui-nightly/union.rs:25:10 | 25 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -93,7 +93,7 @@ error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satis (A, B, C, D, E) (A, B, C, D, E, F) and $N others - = note: required for `ManuallyDrop>` to implement `zerocopy::Immutable` + = note: required for `ManuallyDrop>` to implement `zerocopy_renamed::Immutable` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) help: add `#![feature(trivial_bounds)]` to the crate attributes to enable @@ -102,9 +102,9 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0277]: `IntoBytes2` has 1 total byte(s) of padding - --> tests/ui-nightly/union.rs:40:10 + --> tests/ui-nightly/union.rs:42:10 | -40 | #[derive(IntoBytes)] +42 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -124,19 +124,19 @@ help: add `#![feature(trivial_bounds)]` to the crate attributes to enable | error[E0587]: type has conflicting packed and align representation hints - --> tests/ui-nightly/union.rs:82:1 + --> tests/ui-nightly/union.rs:89:1 | -82 | union Unaligned3 { +89 | union Unaligned3 { | ^^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-nightly/union.rs:106:1 + --> tests/ui-nightly/union.rs:117:1 | -106 | union Unaligned7 { +117 | union Unaligned7 { | ^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute --> tests/ui-nightly/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ diff --git a/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs b/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs index 280f05d410..162d85897e 100644 --- a/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs +++ b/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs @@ -13,11 +13,12 @@ //! test will fail because more than one compile error will be generated. #![deny(deprecated)] -extern crate zerocopy; +extern crate zerocopy_renamed; -use zerocopy::IntoBytes; +use zerocopy_renamed::IntoBytes; #[derive(IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union Foo { a: u8, diff --git a/zerocopy-derive/tests/ui-stable/derive_transparent.stderr b/zerocopy-derive/tests/ui-stable/derive_transparent.stderr index c9200d5cd0..24cf210786 100644 --- a/zerocopy-derive/tests/ui-stable/derive_transparent.stderr +++ b/zerocopy-derive/tests/ui-stable/derive_transparent.stderr @@ -1,16 +1,16 @@ -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/derive_transparent.rs:34:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-stable/derive_transparent.rs:35:23 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -20,22 +20,22 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `TransparentStruct` to implement `zerocopy::TryFromBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::TryFromBytes` --> tests/ui-stable/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-stable/derive_transparent.rs:34:1 + --> tests/ui-stable/derive_transparent.rs:35:1 | -34 | util_assert_impl_all!(TransparentStruct: TryFromBytes); +35 | util_assert_impl_all!(TransparentStruct: TryFromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-stable/derive_transparent.rs:35:23 + --> tests/ui-stable/derive_transparent.rs:36:23 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -60,25 +60,25 @@ note: required for `TransparentStruct` to implement `FromZeros` 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-stable/derive_transparent.rs:35:1 + --> tests/ui-stable/derive_transparent.rs:36:1 | -35 | util_assert_impl_all!(TransparentStruct: FromZeros); +36 | util_assert_impl_all!(TransparentStruct: FromZeros); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/derive_transparent.rs:36:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-stable/derive_transparent.rs:37:23 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); +37 | util_assert_impl_all!(TransparentStruct: FromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -88,31 +88,31 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `TransparentStruct` to implement `zerocopy::FromBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::FromBytes` --> tests/ui-stable/derive_transparent.rs:24:21 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-stable/derive_transparent.rs:36:1 + --> tests/ui-stable/derive_transparent.rs:37:1 | -36 | util_assert_impl_all!(TransparentStruct: FromBytes); +37 | util_assert_impl_all!(TransparentStruct: FromBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` = note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/derive_transparent.rs:37:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-stable/derive_transparent.rs:38:23 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `zerocopy_renamed::IntoBytes`: () AU16 AtomicBool @@ -122,31 +122,31 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` AtomicI8 AtomicIsize and $N others -note: required for `TransparentStruct` to implement `zerocopy::IntoBytes` +note: required for `TransparentStruct` to implement `zerocopy_renamed::IntoBytes` --> tests/ui-stable/derive_transparent.rs:24:10 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-stable/derive_transparent.rs:37:1 + --> tests/ui-stable/derive_transparent.rs:38:1 | -37 | util_assert_impl_all!(TransparentStruct: IntoBytes); +38 | util_assert_impl_all!(TransparentStruct: IntoBytes); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` = note: this error originates in the derive macro `IntoBytes` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/derive_transparent.rs:38:23 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/derive_transparent.rs:39:23 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); +39 | util_assert_impl_all!(TransparentStruct: Unaligned); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -156,14 +156,14 @@ help: the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy` F64 I128 and $N others -note: required for `TransparentStruct` to implement `zerocopy::Unaligned` +note: required for `TransparentStruct` to implement `zerocopy_renamed::Unaligned` --> tests/ui-stable/derive_transparent.rs:24:32 | 24 | #[derive(IntoBytes, FromBytes, Unaligned)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `_::{closure#0}::_::{closure#0}::assert_impl_all` - --> tests/ui-stable/derive_transparent.rs:38:1 + --> tests/ui-stable/derive_transparent.rs:39:1 | -38 | util_assert_impl_all!(TransparentStruct: Unaligned); +39 | util_assert_impl_all!(TransparentStruct: Unaligned); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` = note: this error originates in the derive macro `Unaligned` which comes from the expansion of the macro `util_assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-stable/enum.stderr b/zerocopy-derive/tests/ui-stable/enum.stderr index f92169e2d3..e3ed82c9e9 100644 --- a/zerocopy-derive/tests/ui-stable/enum.stderr +++ b/zerocopy-derive/tests/ui-stable/enum.stderr @@ -1,287 +1,290 @@ error: unrecognized representation hint - --> tests/ui-stable/enum.rs:19:8 + --> tests/ui-stable/enum.rs:20:8 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^ error: unrecognized representation hint - --> tests/ui-stable/enum.rs:25:8 + --> tests/ui-stable/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:30:10 + --> tests/ui-stable/enum.rs:32:10 | -30 | #[derive(FromBytes)] +32 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-stable/enum.rs:37:12 + --> tests/ui-stable/enum.rs:41:12 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:42:10 + --> tests/ui-stable/enum.rs:46:10 | -42 | #[derive(FromBytes)] +46 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:70:1 + --> tests/ui-stable/enum.rs:78:1 | -70 | enum TryFromBytes1 { - | ^^^^ +78 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:75:1 + --> tests/ui-stable/enum.rs:84:1 | -75 | enum TryFromBytes2 { - | ^^^^ +84 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:93:1 - | -93 | enum FromZeros1 { - | ^^^^ + --> tests/ui-stable/enum.rs:104:1 + | +104 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:98:1 - | -98 | enum FromZeros2 { - | ^^^^ + --> tests/ui-stable/enum.rs:110:1 + | +110 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:104:1 + --> tests/ui-stable/enum.rs:117:1 | -104 | enum FromZeros3 { - | ^^^^ +117 | #[zerocopy(crate = "zerocopy_renamed")] + | ^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-stable/enum.rs:110:1 - | -110 | / #[repr(u8)] -111 | | enum FromZeros4 { -112 | | A = 1, -113 | | B = 2, -114 | | } + --> tests/ui-stable/enum.rs:124:1 + | +124 | / #[zerocopy(crate = "zerocopy_renamed")] +125 | | #[repr(u8)] +126 | | enum FromZeros4 { +127 | | A = 1, +128 | | B = 2, +129 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` help: This enum has discriminants which are not literal integers. One of those may define or imply which variant has a discriminant of zero. Use a literal integer to define or imply the variant with a discriminant of zero. - --> tests/ui-stable/enum.rs:119:1 + --> tests/ui-stable/enum.rs:134:1 | -119 | / #[repr(i8)] -120 | | enum FromZeros5 { -121 | | A = NEGATIVE_ONE, -122 | | B, -123 | | } +134 | / #[zerocopy(crate = "zerocopy_renamed")] +135 | | #[repr(i8)] +136 | | enum FromZeros5 { +137 | | A = NEGATIVE_ONE, +138 | | B, +139 | | } | |_^ error: FromZeros only supported on enums with a variant that has a discriminant of `0` - --> tests/ui-stable/enum.rs:134:1 - | -134 | / #[repr(u8)] -135 | | enum FromZeros7 { -136 | | A = 1, -137 | | B(NotFromZeros), -138 | | } + --> tests/ui-stable/enum.rs:151:1 + | +151 | / #[zerocopy(crate = "zerocopy_renamed")] +152 | | #[repr(u8)] +153 | | enum FromZeros7 { +154 | | A = 1, +155 | | B(NotFromZeros), +156 | | } | |_^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:144:10 + --> tests/ui-stable/enum.rs:162:10 | -144 | #[derive(FromBytes)] +162 | #[derive(FromBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:150:8 + --> tests/ui-stable/enum.rs:170:8 | -150 | #[repr(C)] +170 | #[repr(C)] | ^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:156:8 + --> tests/ui-stable/enum.rs:177:8 | -156 | #[repr(usize)] +177 | #[repr(usize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:162:8 + --> tests/ui-stable/enum.rs:184:8 | -162 | #[repr(isize)] +184 | #[repr(isize)] | ^^^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:168:8 + --> tests/ui-stable/enum.rs:191:8 | -168 | #[repr(u32)] +191 | #[repr(u32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:174:8 + --> tests/ui-stable/enum.rs:198:8 | -174 | #[repr(i32)] +198 | #[repr(i32)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:180:8 + --> tests/ui-stable/enum.rs:205:8 | -180 | #[repr(u64)] +205 | #[repr(u64)] | ^^^ error: `FromBytes` only supported on enums with `#[repr(...)]` attributes `u8`, `i8`, `u16`, or `i16` - --> tests/ui-stable/enum.rs:186:8 + --> tests/ui-stable/enum.rs:212:8 | -186 | #[repr(i64)] +212 | #[repr(i64)] | ^^^ error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:456:10 + --> tests/ui-stable/enum.rs:483:10 | -456 | #[derive(Unaligned)] +483 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:462:10 + --> tests/ui-stable/enum.rs:490:10 | -462 | #[derive(Unaligned)] +490 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:468:10 + --> tests/ui-stable/enum.rs:497:10 | -468 | #[derive(Unaligned)] +497 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:474:10 + --> tests/ui-stable/enum.rs:504:10 | -474 | #[derive(Unaligned)] +504 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:480:10 + --> tests/ui-stable/enum.rs:511:10 | -480 | #[derive(Unaligned)] +511 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:486:10 + --> tests/ui-stable/enum.rs:518:10 | -486 | #[derive(Unaligned)] +518 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:492:10 + --> tests/ui-stable/enum.rs:525:10 | -492 | #[derive(Unaligned)] +525 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:498:10 + --> tests/ui-stable/enum.rs:532:10 | -498 | #[derive(Unaligned)] +532 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(u8)] or #[repr(i8)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/enum.rs:504:10 + --> tests/ui-stable/enum.rs:539:10 | -504 | #[derive(Unaligned)] +539 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-stable/enum.rs:511:12 + --> tests/ui-stable/enum.rs:548:12 | -511 | #[repr(u8, align(2))] +548 | #[repr(u8, align(2))] | ^^^^^ error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-stable/enum.rs:517:12 + --> tests/ui-stable/enum.rs:555:12 | -517 | #[repr(i8, align(2))] +555 | #[repr(i8, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/enum.rs:523:18 + --> tests/ui-stable/enum.rs:562:18 | -523 | #[repr(align(1), align(2))] +562 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/enum.rs:529:18 + --> tests/ui-stable/enum.rs:569:18 | -529 | #[repr(align(2), align(4))] +569 | #[repr(align(2), align(4))] | ^^^^^ error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:562:10 + --> tests/ui-stable/enum.rs:606:10 | -562 | #[derive(IntoBytes)] +606 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)] or #[repr(Int)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/enum.rs:568:10 + --> tests/ui-stable/enum.rs:613:10 | -568 | #[derive(IntoBytes)] +613 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: generic parameters may not be used in const operations - --> tests/ui-stable/enum.rs:576:7 + --> tests/ui-stable/enum.rs:623:7 | -576 | A(T), +623 | A(T), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions error[E0565]: meta item in `repr` must be an identifier - --> tests/ui-stable/enum.rs:19:1 + --> tests/ui-stable/enum.rs:20:1 | -19 | #[repr("foo")] +20 | #[repr("foo")] | ^^^^^^^^^^^^^^ error[E0552]: unrecognized representation hint - --> tests/ui-stable/enum.rs:25:8 + --> tests/ui-stable/enum.rs:27:8 | -25 | #[repr(foo)] +27 | #[repr(foo)] | ^^^ | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` = note: for more information, visit error[E0566]: conflicting representation hints - --> tests/ui-stable/enum.rs:37:8 + --> tests/ui-stable/enum.rs:41:8 | -37 | #[repr(u8, u16)] +41 | #[repr(u8, u16)] | ^^ ^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! @@ -289,9 +292,9 @@ error[E0566]: conflicting representation hints = note: `#[deny(conflicting_repr_hints)]` (part of `#[deny(future_incompatible)]`) on by default error[E0277]: the trait bound `UnsafeCell<()>: Immutable` is not satisfied - --> tests/ui-stable/enum.rs:51:10 + --> tests/ui-stable/enum.rs:56:10 | -51 | #[derive(Immutable)] +56 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` @@ -309,9 +312,9 @@ error[E0277]: the trait bound `UnsafeCell<()>: Immutable` is not satisfied = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `UnsafeCell: Immutable` is not satisfied - --> tests/ui-stable/enum.rs:59:10 + --> tests/ui-stable/enum.rs:66:10 | -59 | #[derive(Immutable)] +66 | #[derive(Immutable)] | ^^^^^^^^^ the trait `Immutable` is not implemented for `UnsafeCell` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell` @@ -329,15 +332,15 @@ error[E0277]: the trait bound `UnsafeCell: Immutable` is not satisfied = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotTryFromBytes: TryFromBytes` is not satisfied - --> tests/ui-stable/enum.rs:82:10 + --> tests/ui-stable/enum.rs:92:10 | -82 | #[derive(TryFromBytes)] +92 | #[derive(TryFromBytes)] | ^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `TryFromBytes` is not implemented for `NotTryFromBytes` - --> tests/ui-stable/enum.rs:80:1 + --> tests/ui-stable/enum.rs:90:1 | -80 | struct NotTryFromBytes; +90 | struct NotTryFromBytes; | ^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotTryFromBytes` = help: the following other types implement trait `TryFromBytes`: @@ -354,15 +357,15 @@ help: the trait `TryFromBytes` is not implemented for `NotTryFromBytes` = note: this error originates in the derive macro `TryFromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotFromZeros: TryFromBytes` is not satisfied - --> tests/ui-stable/enum.rs:127:10 + --> tests/ui-stable/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `TryFromBytes` is not implemented for `NotFromZeros` - --> tests/ui-stable/enum.rs:125:1 + --> tests/ui-stable/enum.rs:141:1 | -125 | struct NotFromZeros; +141 | struct NotFromZeros; | ^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotFromZeros` = help: the following other types implement trait `TryFromBytes`: @@ -379,15 +382,15 @@ help: the trait `TryFromBytes` is not implemented for `NotFromZeros` = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotFromZeros: FromZeros` is not satisfied - --> tests/ui-stable/enum.rs:127:10 + --> tests/ui-stable/enum.rs:143:10 | -127 | #[derive(FromZeros)] +143 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotFromZeros` - --> tests/ui-stable/enum.rs:125:1 + --> tests/ui-stable/enum.rs:141:1 | -125 | struct NotFromZeros; +141 | struct NotFromZeros; | ^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromZeros)]` to `NotFromZeros` = help: the following other types implement trait `FromZeros`: @@ -404,9 +407,9 @@ help: the trait `FromZeros` is not implemented for `NotFromZeros` = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `bool: FromBytes` is not satisfied - --> tests/ui-stable/enum.rs:191:10 + --> tests/ui-stable/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromBytes` is not implemented for `bool` | = note: Consider adding `#[derive(FromBytes)]` to `bool` @@ -424,9 +427,9 @@ error[E0277]: the trait bound `bool: FromBytes` is not satisfied = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes1` has 1 total byte(s) of padding - --> tests/ui-stable/enum.rs:538:10 + --> tests/ui-stable/enum.rs:578:10 | -538 | #[derive(IntoBytes)] +578 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -438,9 +441,9 @@ error[E0277]: `IntoBytes1` has 1 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes2` has 3 total byte(s) of padding - --> tests/ui-stable/enum.rs:549:10 + --> tests/ui-stable/enum.rs:591:10 | -549 | #[derive(IntoBytes)] +591 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -452,9 +455,9 @@ error[E0277]: `IntoBytes2` has 3 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes3` has 2 total byte(s) of padding - --> tests/ui-stable/enum.rs:555:10 + --> tests/ui-stable/enum.rs:598:10 | -555 | #[derive(IntoBytes)] +598 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -466,22 +469,22 @@ error[E0277]: `IntoBytes3` has 2 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: generic `Self` types are currently not permitted in anonymous constants - --> tests/ui-stable/enum.rs:573:10 + --> tests/ui-stable/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ | note: not a concrete type - --> tests/ui-stable/enum.rs:573:10 + --> tests/ui-stable/enum.rs:619:10 | -573 | #[derive(IntoBytes)] +619 | #[derive(IntoBytes)] | ^^^^^^^^^ = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `bool: FromBytes` is not satisfied - --> tests/ui-stable/enum.rs:191:10 + --> tests/ui-stable/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ the trait `FromBytes` is not implemented for `bool` | = note: Consider adding `#[derive(FromBytes)]` to `bool` @@ -496,13 +499,13 @@ error[E0277]: the trait bound `bool: FromBytes` is not satisfied (A, B, C, D, E, F, G, H) and $N others note: required for `FooU8` to implement `FromBytes` - --> tests/ui-stable/enum.rs:191:10 + --> tests/ui-stable/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_is_from_bytes` - --> tests/ui-stable/enum.rs:191:10 + --> tests/ui-stable/enum.rs:217:10 | -191 | #[derive(FromBytes)] +217 | #[derive(FromBytes)] | ^^^^^^^^^ required by this bound in `assert_is_from_bytes` = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr b/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr index 02322be1c9..09d405f7bd 100644 --- a/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr +++ b/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr @@ -1,11 +1,11 @@ error: FromBytes only supported on repr(u8) enum with 256 variants --> tests/ui-stable/enum_from_bytes_u8_too_few.rs:15:1 | - 15 | / #[repr(u8)] - 16 | | enum Foo { - 17 | | Variant0, - 18 | | Variant1, + 15 | / #[zerocopy(crate = "zerocopy_renamed")] + 16 | | #[repr(u8)] + 17 | | enum Foo { + 18 | | Variant0, ... | -271 | | Variant254, -272 | | } +272 | | Variant254, +273 | | } | |_^ diff --git a/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr b/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr index 5138c9e73e..32cb5fb17a 100644 --- a/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr @@ -1,24 +1,24 @@ -warning: unused import: `zerocopy::KnownLayout` +warning: unused import: `zerocopy_renamed::KnownLayout` --> tests/ui-stable/late_compile_pass.rs:15:5 | -15 | use zerocopy::KnownLayout; - | ^^^^^^^^^^^^^^^^^^^^^ +15 | use zerocopy_renamed::KnownLayout; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied --> tests/ui-stable/late_compile_pass.rs:29:10 | 29 | #[derive(TryFromBytes)] | ^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -31,19 +31,19 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` = help: see issue #48214 = note: this error originates in the derive macro `TryFromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:38:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] +39 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -57,9 +57,9 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:38:10 + --> tests/ui-stable/late_compile_pass.rs:39:10 | -38 | #[derive(FromZeros)] +39 | #[derive(FromZeros)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -81,19 +81,19 @@ help: the trait `FromZeros` is not implemented for `NotZerocopy` = help: see issue #48214 = note: this error originates in the derive macro `FromZeros` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::TryFromBytes` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::TryFromBytes` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::TryFromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::TryFromBytes`: + = help: the following other types implement trait `zerocopy_renamed::TryFromBytes`: () (A, B) (A, B, C) @@ -107,9 +107,9 @@ help: the trait `zerocopy::TryFromBytes` is not implemented for `NotZerocopy` = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:47:10 + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | help: the trait `FromZeros` is not implemented for `NotZerocopy` @@ -131,19 +131,19 @@ help: the trait `FromZeros` is not implemented for `NotZerocopy` = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -156,19 +156,19 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` = help: see issue #48214 = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::IntoBytes` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:56:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::IntoBytes` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:59:10 | -56 | #[derive(IntoBytes)] +59 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::IntoBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(IntoBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::IntoBytes`: + = help: the following other types implement trait `zerocopy_renamed::IntoBytes`: () AU16 AtomicBool @@ -181,19 +181,19 @@ help: the trait `zerocopy::IntoBytes` is not implemented for `NotZerocopy` = help: see issue #48214 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:66:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:70:10 | -66 | #[derive(Unaligned)] +70 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-stable/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -206,19 +206,19 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:74:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:79:10 | -74 | #[derive(Unaligned)] +79 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-stable/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -231,19 +231,19 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:81:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:87:10 | -81 | #[derive(Unaligned)] +87 | #[derive(Unaligned)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-stable/../include.rs | | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -256,19 +256,19 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotZerocopy: zerocopy::FromBytes` is not satisfied - --> tests/ui-stable/late_compile_pass.rs:47:10 +error[E0277]: the trait bound `NotZerocopy: zerocopy_renamed::FromBytes` is not satisfied + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` +help: the trait `zerocopy_renamed::FromBytes` is not implemented for `NotZerocopy` --> tests/ui-stable/../include.rs | | pub struct NotZerocopy(pub T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(FromBytes)]` to `NotZerocopy` - = help: the following other types implement trait `zerocopy::FromBytes`: + = help: the following other types implement trait `zerocopy_renamed::FromBytes`: () (A, B) (A, B, C) @@ -278,14 +278,14 @@ help: the trait `zerocopy::FromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G) (A, B, C, D, E, F, G, H) and $N others -note: required for `FromBytes1` to implement `zerocopy::FromBytes` - --> tests/ui-stable/late_compile_pass.rs:47:10 +note: required for `FromBytes1` to implement `zerocopy_renamed::FromBytes` + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro -note: required by a bound in `_::_::::is_bit_valid::assert_is_from_bytes` - --> tests/ui-stable/late_compile_pass.rs:47:10 +note: required by a bound in `_::_::::is_bit_valid::assert_is_from_bytes` + --> tests/ui-stable/late_compile_pass.rs:49:10 | -47 | #[derive(FromBytes)] +49 | #[derive(FromBytes)] | ^^^^^^^^^ required by this bound in `assert_is_from_bytes` = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr b/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr index 3a937f8fdf..49083c8778 100644 --- a/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr @@ -1,37 +1,37 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied - --> tests/ui-stable/mid_compile_pass.rs:59:26 + --> tests/ui-stable/mid_compile_pass.rs:63:26 | -59 | fn test_kl13(t: T) -> impl KnownLayout { +63 | fn test_kl13(t: T) -> impl KnownLayout { | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T` -60 | KL13(0u8, t) +64 | KL13(0u8, t) | ------------ return type was inferred to be `KL13` here | = note: Consider adding `#[derive(KnownLayout)]` to `T` note: required for `KL13` to implement `KnownLayout` - --> tests/ui-stable/mid_compile_pass.rs:55:10 + --> tests/ui-stable/mid_compile_pass.rs:58:10 | -55 | #[derive(KnownLayout)] +58 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` with trait `KnownLayout` | -59 | fn test_kl13(t: T) -> impl KnownLayout { - | +++++++++++++++++++++++ +63 | fn test_kl13(t: T) -> impl KnownLayout { + | +++++++++++++++++++++++++++++++ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-stable/mid_compile_pass.rs:31:15 + --> tests/ui-stable/mid_compile_pass.rs:32:15 | -30 | fn test_kl04(kl: &KL04) { +31 | fn test_kl04(kl: &KL04) { | - this type parameter needs to be `Sized` -31 | assert_kl(kl); +32 | assert_kl(kl); | --------- ^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call | note: required because it appears within the type `KL04` - --> tests/ui-stable/mid_compile_pass.rs:28:8 + --> tests/ui-stable/mid_compile_pass.rs:29:8 | -28 | struct KL04(u8, T); +29 | struct KL04(u8, T); | ^^^^ note: required for `KL04` to implement `KnownLayout` --> tests/ui-stable/mid_compile_pass.rs:27:10 @@ -46,29 +46,29 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -30 - fn test_kl04(kl: &KL04) { -30 + fn test_kl04(kl: &KL04) { +31 - fn test_kl04(kl: &KL04) { +31 + fn test_kl04(kl: &KL04) { | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> tests/ui-stable/mid_compile_pass.rs:40:15 + --> tests/ui-stable/mid_compile_pass.rs:42:15 | -39 | fn test_kl06(kl: &KL06) { +41 | fn test_kl06(kl: &KL06) { | - this type parameter needs to be `Sized` -40 | assert_kl(kl); +42 | assert_kl(kl); | --------- ^^ doesn't have a size known at compile-time | | | required by a bound introduced by this call | note: required because it appears within the type `KL06` - --> tests/ui-stable/mid_compile_pass.rs:37:8 + --> tests/ui-stable/mid_compile_pass.rs:39:8 | -37 | struct KL06(u8, T); +39 | struct KL06(u8, T); | ^^^^ note: required for `KL06` to implement `KnownLayout` - --> tests/ui-stable/mid_compile_pass.rs:36:10 + --> tests/ui-stable/mid_compile_pass.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_kl` --> tests/ui-stable/mid_compile_pass.rs:23:26 @@ -78,22 +78,22 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider removing the `?Sized` bound to make the type parameter `Sized` | -39 - fn test_kl06(kl: &KL06) { -39 + fn test_kl06(kl: &KL06) { +41 - fn test_kl06(kl: &KL06) { +41 + fn test_kl06(kl: &KL06) { | error[E0277]: the trait bound `KL12: KnownLayout` is not satisfied - --> tests/ui-stable/mid_compile_pass.rs:50:15 + --> tests/ui-stable/mid_compile_pass.rs:53:15 | -50 | assert_kl(kl) +53 | assert_kl(kl) | --------- ^^ the trait `KnownLayout` is not implemented for `KL12` | | | required by a bound introduced by this call | note: required for `KL12` to implement `KnownLayout` - --> tests/ui-stable/mid_compile_pass.rs:45:10 + --> tests/ui-stable/mid_compile_pass.rs:47:10 | -45 | #[derive(KnownLayout)] +47 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `assert_kl` --> tests/ui-stable/mid_compile_pass.rs:23:26 @@ -103,7 +103,7 @@ note: required by a bound in `assert_kl` = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider borrowing here | -50 | assert_kl(&kl) +53 | assert_kl(&kl) | + -50 | assert_kl(&mut kl) +53 | assert_kl(&mut kl) | ++++ diff --git a/zerocopy-derive/tests/ui-stable/privacy.stderr b/zerocopy-derive/tests/ui-stable/privacy.stderr index 4635e1913c..c03b376f87 100644 --- a/zerocopy-derive/tests/ui-stable/privacy.stderr +++ b/zerocopy-derive/tests/ui-stable/privacy.stderr @@ -1,17 +1,17 @@ error: type `private::_::_::_::ẕb` is private - --> tests/ui-stable/privacy.rs:76:57 - | -76 | let _: >::Type = - | ^ private type + --> tests/ui-stable/privacy.rs:100:9 + | +100 | _, + | ^ private type error: type `private::_::_::_::ẕ1` is private - --> tests/ui-stable/privacy.rs:83:56 - | -83 | let _: >::Type = - | ^ private type + --> tests/ui-stable/privacy.rs:113:9 + | +113 | _, + | ^ private type error: type `private::_::_::_::ẕb` is private - --> tests/ui-stable/privacy.rs:89:41 - | -89 | let _: >::Type = 0u16; - | ^ private type + --> tests/ui-stable/privacy.rs:122:49 + | +122 | let _: >::Type = + | ^ private type diff --git a/zerocopy-derive/tests/ui-stable/struct.stderr b/zerocopy-derive/tests/ui-stable/struct.stderr index 10d76762ce..58b7272613 100644 --- a/zerocopy-derive/tests/ui-stable/struct.stderr +++ b/zerocopy-derive/tests/ui-stable/struct.stderr @@ -1,89 +1,89 @@ error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:167:11 + --> tests/ui-stable/struct.rs:185:11 | -167 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs +185 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs | ^ error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/struct.rs:172:10 + --> tests/ui-stable/struct.rs:190:10 | -172 | #[derive(IntoBytes)] +190 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/struct.rs:177:10 + --> tests/ui-stable/struct.rs:196:10 | -177 | #[derive(IntoBytes)] +196 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout - --> tests/ui-stable/struct.rs:200:10 + --> tests/ui-stable/struct.rs:221:10 | -200 | #[derive(IntoBytes)] +221 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-stable/struct.rs:211:11 + --> tests/ui-stable/struct.rs:234:11 | -211 | #[repr(C, align(2))] +234 | #[repr(C, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:215:8 + --> tests/ui-stable/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:221:16 + --> tests/ui-stable/struct.rs:246:16 | -221 | #[repr(packed, align(2))] +246 | #[repr(packed, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:225:18 + --> tests/ui-stable/struct.rs:251:18 | -225 | #[repr(align(1), align(2))] +251 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:229:18 + --> tests/ui-stable/struct.rs:256:18 | -229 | #[repr(align(2), align(4))] +256 | #[repr(align(2), align(4))] | ^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/struct.rs:232:10 + --> tests/ui-stable/struct.rs:259:10 | -232 | #[derive(Unaligned)] +259 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/struct.rs:235:10 + --> tests/ui-stable/struct.rs:263:10 | -235 | #[derive(Unaligned)] +263 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: this conflicts with another representation hint - --> tests/ui-stable/struct.rs:245:8 + --> tests/ui-stable/struct.rs:275:8 | -245 | #[repr(C, packed(2))] +275 | #[repr(C, packed(2))] | ^ error[E0692]: transparent struct cannot have other repr hints - --> tests/ui-stable/struct.rs:215:8 + --> tests/ui-stable/struct.rs:239:8 | -215 | #[repr(transparent, align(2))] +239 | #[repr(transparent, align(2))] | ^^^^^^^^^^^ ^^^^^^^^ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time @@ -94,41 +94,41 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL00` - --> tests/ui-stable/struct.rs:32:8 + --> tests/ui-stable/struct.rs:33:8 | -32 | struct KL00(u8, NotKnownLayoutDst); +33 | struct KL00(u8, NotKnownLayoutDst); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-stable/struct.rs:36:10 + --> tests/ui-stable/struct.rs:37:10 | -36 | #[derive(KnownLayout)] +37 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `KL02` - --> tests/ui-stable/struct.rs:37:8 + --> tests/ui-stable/struct.rs:39:8 | -37 | struct KL02(u8, [u8]); +39 | struct KL02(u8, [u8]); | ^^^^ = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy::KnownLayout` is not satisfied - --> tests/ui-stable/struct.rs:41:10 +error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-stable/struct.rs:43:10 | -41 | #[derive(KnownLayout)] +43 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayoutDst` +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayoutDst` --> tests/ui-stable/struct.rs:27:1 | 27 | struct NotKnownLayoutDst([u8]); | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayoutDst` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -141,19 +141,19 @@ help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayoutDs = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `NotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-stable/struct.rs:47:10 +error[E0277]: the trait bound `NotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-stable/struct.rs:50:10 | -47 | #[derive(KnownLayout)] +50 | #[derive(KnownLayout)] | ^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayout` +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `NotKnownLayout` --> tests/ui-stable/struct.rs:25:1 | 25 | struct NotKnownLayout; | ^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayout` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -166,14 +166,14 @@ help: the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayout` = help: see issue #48214 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/struct.rs:55:10 +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-stable/struct.rs:59:10 | -55 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` +59 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -186,14 +186,14 @@ error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satis = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell: zerocopy::Immutable` is not satisfied - --> tests/ui-stable/struct.rs:60:10 +error[E0277]: the trait bound `UnsafeCell: zerocopy_renamed::Immutable` is not satisfied + --> tests/ui-stable/struct.rs:65:10 | -60 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell` +65 | #[derive(Immutable)] + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -203,14 +203,14 @@ error[E0277]: the trait bound `UnsafeCell: zerocopy::Immutable` is not satis (A, B, C, D, E) (A, B, C, D, E, F) and $N others - = note: required for `[UnsafeCell; 0]` to implement `zerocopy::Immutable` + = note: required for `[UnsafeCell; 0]` to implement `zerocopy_renamed::Immutable` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-stable/struct.rs:71:1 + --> tests/ui-stable/struct.rs:78:1 | -71 | struct TryFromBytesPacked { +78 | struct TryFromBytesPacked { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -220,9 +220,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-stable/struct.rs:77:1 + --> tests/ui-stable/struct.rs:85:1 | -77 | struct TryFromBytesPackedN { +85 | struct TryFromBytesPackedN { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -232,9 +232,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-stable/struct.rs:83:1 + --> tests/ui-stable/struct.rs:92:1 | -83 | struct TryFromBytesCPacked { +92 | struct TryFromBytesCPacked { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -244,9 +244,9 @@ note: `AU16` has a `#[repr(align)]` attribute | ^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-stable/struct.rs:89:1 + --> tests/ui-stable/struct.rs:99:1 | -89 | struct TryFromBytesCPackedN { +99 | struct TryFromBytesCPackedN { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute @@ -255,19 +255,19 @@ note: `AU16` has a `#[repr(align)]` attribute | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/struct.rs:100:10 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/struct.rs:110:10 | -100 | #[derive(IntoBytes)] +110 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-stable/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -281,9 +281,9 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes2` has 1 total byte(s) of padding - --> tests/ui-stable/struct.rs:107:10 + --> tests/ui-stable/struct.rs:118:10 | -107 | #[derive(IntoBytes)] +118 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -295,9 +295,9 @@ error[E0277]: `IntoBytes2` has 1 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes3` has 1 total byte(s) of padding - --> tests/ui-stable/struct.rs:114:10 + --> tests/ui-stable/struct.rs:126:10 | -114 | #[derive(IntoBytes)] +126 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -309,16 +309,16 @@ error[E0277]: `IntoBytes3` has 1 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> tests/ui-stable/struct.rs:130:10 + --> tests/ui-stable/struct.rs:143:10 | -130 | #[derive(IntoBytes)] +143 | #[derive(IntoBytes)] | ^^^^^^^^^ doesn't have a size known at compile-time | = help: within `IntoBytes4`, the trait `Sized` is not implemented for `[u8]` note: required because it appears within the type `IntoBytes4` - --> tests/ui-stable/struct.rs:132:8 + --> tests/ui-stable/struct.rs:146:8 | -132 | struct IntoBytes4 { +146 | struct IntoBytes4 { | ^^^^^^^^^^ = note: required for `IntoBytes4` to implement `macro_util::__size_of::Sized` note: required by a bound in `macro_util::__size_of::size_of` @@ -329,9 +329,9 @@ note: required by a bound in `macro_util::__size_of::size_of` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `[u8]` is unsized - --> tests/ui-stable/struct.rs:134:8 + --> tests/ui-stable/struct.rs:148:8 | -134 | b: SliceU8, +148 | b: SliceU8, | ^^^^^^^ `IntoBytes` needs all field types to be `Sized` in order to determine whether there is padding | = help: the trait `Sized` is not implemented for `[u8]` @@ -345,9 +345,9 @@ note: required by a bound in `macro_util::__size_of::size_of` | ^^^^^ required by this bound in `size_of` error[E0277]: `IntoBytes5` has one or more padding bytes - --> tests/ui-stable/struct.rs:139:10 + --> tests/ui-stable/struct.rs:153:10 | -139 | #[derive(IntoBytes)] +153 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -359,9 +359,9 @@ error[E0277]: `IntoBytes5` has one or more padding bytes = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes6` has one or more padding bytes - --> tests/ui-stable/struct.rs:148:10 + --> tests/ui-stable/struct.rs:163:10 | -148 | #[derive(IntoBytes)] +163 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -373,9 +373,9 @@ error[E0277]: `IntoBytes6` has one or more padding bytes = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes7` has one or more padding bytes - --> tests/ui-stable/struct.rs:158:10 + --> tests/ui-stable/struct.rs:174:10 | -158 | #[derive(IntoBytes)] +174 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -387,24 +387,24 @@ error[E0277]: `IntoBytes7` has one or more padding bytes = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0587]: type has conflicting packed and align representation hints - --> tests/ui-stable/struct.rs:222:1 + --> tests/ui-stable/struct.rs:247:1 | -222 | struct Unaligned3; +247 | struct Unaligned3; | ^^^^^^^^^^^^^^^^^ -error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy::KnownLayout` is not satisfied - --> tests/ui-stable/struct.rs:248:10 +error[E0277]: the trait bound `SplitAtNotKnownLayout: zerocopy_renamed::KnownLayout` is not satisfied + --> tests/ui-stable/struct.rs:278:10 | -248 | #[derive(SplitAt)] +278 | #[derive(SplitAt)] | ^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::KnownLayout` is not implemented for `SplitAtNotKnownLayout` - --> tests/ui-stable/struct.rs:250:1 +help: the trait `zerocopy_renamed::KnownLayout` is not implemented for `SplitAtNotKnownLayout` + --> tests/ui-stable/struct.rs:281:1 | -250 | struct SplitAtNotKnownLayout([u8]); +281 | struct SplitAtNotKnownLayout([u8]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(KnownLayout)]` to `SplitAtNotKnownLayout` - = help: the following other types implement trait `zerocopy::KnownLayout`: + = help: the following other types implement trait `zerocopy_renamed::KnownLayout`: &T &mut T () @@ -422,9 +422,9 @@ note: required by a bound in `SplitAt` = note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `u8: SplitAt` is not satisfied - --> tests/ui-stable/struct.rs:252:10 + --> tests/ui-stable/struct.rs:283:10 | -252 | #[derive(SplitAt, KnownLayout)] +283 | #[derive(SplitAt, KnownLayout)] | ^^^^^^^ the trait `SplitAt` is not implemented for `u8` | = note: Consider adding `#[derive(SplitAt)]` to `u8` @@ -435,19 +435,19 @@ error[E0277]: the trait bound `u8: SplitAt` is not satisfied = help: see issue #48214 = note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied - --> tests/ui-stable/struct.rs:195:28 +error[E0277]: the trait bound `AU16: zerocopy_renamed::Unaligned` is not satisfied + --> tests/ui-stable/struct.rs:216:28 | -195 | is_into_bytes_11::>(); +216 | is_into_bytes_11::>(); | ^^^^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `zerocopy::Unaligned` is not implemented for `AU16` +help: the trait `zerocopy_renamed::Unaligned` is not implemented for `AU16` --> tests/ui-stable/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ = note: Consider adding `#[derive(Unaligned)]` to `AU16` - = help: the following other types implement trait `zerocopy::Unaligned`: + = help: the following other types implement trait `zerocopy_renamed::Unaligned`: () AtomicBool AtomicI8 @@ -457,14 +457,14 @@ help: the trait `zerocopy::Unaligned` is not implemented for `AU16` F64 I128 and $N others -note: required for `IntoBytes11` to implement `zerocopy::IntoBytes` - --> tests/ui-stable/struct.rs:184:10 +note: required for `IntoBytes11` to implement `zerocopy_renamed::IntoBytes` + --> tests/ui-stable/struct.rs:204:10 | -184 | #[derive(IntoBytes)] +204 | #[derive(IntoBytes)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro note: required by a bound in `is_into_bytes_11` - --> tests/ui-stable/struct.rs:193:24 + --> tests/ui-stable/struct.rs:214:24 | -193 | fn is_into_bytes_11() { +214 | fn is_into_bytes_11() { | ^^^^^^^^^ required by this bound in `is_into_bytes_11` = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/tests/ui-stable/union.stderr b/zerocopy-derive/tests/ui-stable/union.stderr index bff92a1746..aa5d69d98b 100644 --- a/zerocopy-derive/tests/ui-stable/union.stderr +++ b/zerocopy-derive/tests/ui-stable/union.stderr @@ -1,71 +1,71 @@ error: unsupported on types with type parameters - --> tests/ui-stable/union.rs:34:10 + --> tests/ui-stable/union.rs:35:10 | -34 | #[derive(IntoBytes)] +35 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-stable/union.rs:48:10 + --> tests/ui-stable/union.rs:51:10 | -48 | #[derive(IntoBytes)] +51 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: must be #[repr(C)], #[repr(packed)], or #[repr(transparent)] - --> tests/ui-stable/union.rs:54:10 + --> tests/ui-stable/union.rs:58:10 | -54 | #[derive(IntoBytes)] +58 | #[derive(IntoBytes)] | ^^^^^^^^^ | = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot derive `Unaligned` on type with alignment greater than 1 - --> tests/ui-stable/union.rs:65:11 + --> tests/ui-stable/union.rs:71:11 | -65 | #[repr(C, align(2))] +71 | #[repr(C, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/union.rs:81:16 + --> tests/ui-stable/union.rs:88:16 | -81 | #[repr(packed, align(2))] +88 | #[repr(packed, align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/union.rs:87:18 + --> tests/ui-stable/union.rs:95:18 | -87 | #[repr(align(1), align(2))] +95 | #[repr(align(1), align(2))] | ^^^^^ error: this conflicts with another representation hint - --> tests/ui-stable/union.rs:93:18 - | -93 | #[repr(align(2), align(4))] - | ^^^^^ + --> tests/ui-stable/union.rs:102:18 + | +102 | #[repr(align(2), align(4))] + | ^^^^^ error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/union.rs:98:10 - | -98 | #[derive(Unaligned)] - | ^^^^^^^^^ - | - = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) + --> tests/ui-stable/union.rs:107:10 + | +107 | #[derive(Unaligned)] + | ^^^^^^^^^ + | + = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment - --> tests/ui-stable/union.rs:104:10 + --> tests/ui-stable/union.rs:114:10 | -104 | #[derive(Unaligned)] +114 | #[derive(Unaligned)] | ^^^^^^^^^ | = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) warning: unexpected `cfg` condition name: `zerocopy_derive_union_into_bytes` - --> tests/ui-stable/union.rs:40:10 + --> tests/ui-stable/union.rs:42:10 | -40 | #[derive(IntoBytes)] +42 | #[derive(IntoBytes)] | ^^^^^^^^^ | = help: expected names are: `docsrs`, `feature`, and `test` and 31 more @@ -76,14 +76,14 @@ warning: unexpected `cfg` condition name: `zerocopy_derive_union_into_bytes` = note: `#[warn(unexpected_cfgs)]` on by default = note: this warning originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied +error[E0277]: the trait bound `UnsafeCell<()>: zerocopy_renamed::Immutable` is not satisfied --> tests/ui-stable/union.rs:25:10 | 25 | #[derive(Immutable)] - | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` + | ^^^^^^^^^ the trait `zerocopy_renamed::Immutable` is not implemented for `UnsafeCell<()>` | = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` - = help: the following other types implement trait `zerocopy::Immutable`: + = help: the following other types implement trait `zerocopy_renamed::Immutable`: &T &mut T () @@ -93,14 +93,14 @@ error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satis (A, B, C, D, E) (A, B, C, D, E, F) and $N others - = note: required for `ManuallyDrop>` to implement `zerocopy::Immutable` + = note: required for `ManuallyDrop>` to implement `zerocopy_renamed::Immutable` = help: see issue #48214 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `IntoBytes2` has 1 total byte(s) of padding - --> tests/ui-stable/union.rs:40:10 + --> tests/ui-stable/union.rs:42:10 | -40 | #[derive(IntoBytes)] +42 | #[derive(IntoBytes)] | ^^^^^^^^^ types with padding cannot implement `IntoBytes` | = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields @@ -112,19 +112,19 @@ error[E0277]: `IntoBytes2` has 1 total byte(s) of padding = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0587]: type has conflicting packed and align representation hints - --> tests/ui-stable/union.rs:82:1 + --> tests/ui-stable/union.rs:89:1 | -82 | union Unaligned3 { +89 | union Unaligned3 { | ^^^^^^^^^^^^^^^^ error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type - --> tests/ui-stable/union.rs:106:1 + --> tests/ui-stable/union.rs:117:1 | -106 | union Unaligned7 { +117 | union Unaligned7 { | ^^^^^^^^^^^^^^^^ | note: `AU16` has a `#[repr(align)]` attribute --> tests/ui-stable/../include.rs | - 63 | pub struct AU16(pub u16); + 64 | pub struct AU16(pub u16); | ^^^^^^^^^^^^^^^ diff --git a/zerocopy-derive/tests/union_from_bytes.rs b/zerocopy-derive/tests/union_from_bytes.rs index f8482248b1..a62dcd8602 100644 --- a/zerocopy-derive/tests/union_from_bytes.rs +++ b/zerocopy-derive/tests/union_from_bytes.rs @@ -16,6 +16,7 @@ include!("include.rs"); // - all fields are `imp::FromBytes` #[derive(Clone, Copy, imp::Immutable, imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union Zst { a: (), } @@ -24,6 +25,7 @@ util_assert_impl_all!(Zst: imp::FromBytes); test_trivial_is_bit_valid!(Zst => test_zst_trivial_is_bit_valid); #[derive(imp::Immutable, imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union One { a: u8, } @@ -32,6 +34,7 @@ util_assert_impl_all!(One: imp::FromBytes); test_trivial_is_bit_valid!(One => test_one_trivial_is_bit_valid); #[derive(imp::Immutable, imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union Two { a: u8, b: Zst, @@ -41,6 +44,7 @@ util_assert_impl_all!(Two: imp::FromBytes); test_trivial_is_bit_valid!(Two => test_two_trivial_is_bit_valid); #[derive(imp::Immutable, imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where I::Item: imp::Copy, @@ -59,6 +63,7 @@ test_trivial_is_bit_valid!(TypeParams<'static, (), imp::IntoIter<()>> => test_ty // Deriving `imp::FromBytes` should work if the union has bounded parameters. #[derive(imp::Immutable, imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::FromBytes, const N: usize> where diff --git a/zerocopy-derive/tests/union_from_zeros.rs b/zerocopy-derive/tests/union_from_zeros.rs index 4f5b8e17be..d2aa19eadb 100644 --- a/zerocopy-derive/tests/union_from_zeros.rs +++ b/zerocopy-derive/tests/union_from_zeros.rs @@ -16,6 +16,7 @@ include!("include.rs"); // - all fields are `imp::FromZeros` #[derive(Clone, Copy, imp::Immutable, imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] union Zst { a: (), } @@ -23,6 +24,7 @@ union Zst { util_assert_impl_all!(Zst: imp::FromZeros); #[derive(imp::Immutable, imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] union One { a: bool, } @@ -30,6 +32,7 @@ union One { util_assert_impl_all!(One: imp::FromZeros); #[derive(imp::Immutable, imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] union Two { a: bool, b: Zst, @@ -38,6 +41,7 @@ union Two { util_assert_impl_all!(Two: imp::FromZeros); #[derive(imp::Immutable, imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where I::Item: imp::Copy, @@ -55,6 +59,7 @@ util_assert_impl_all!(TypeParams<'static, (), imp::IntoIter<()>>: imp::FromZeros // Deriving `imp::FromZeros` should work if the union has bounded parameters. #[derive(imp::Immutable, imp::FromZeros)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::FromZeros, const N: usize> where diff --git a/zerocopy-derive/tests/union_known_layout.rs b/zerocopy-derive/tests/union_known_layout.rs index c8668759d3..0e817d2639 100644 --- a/zerocopy-derive/tests/union_known_layout.rs +++ b/zerocopy-derive/tests/union_known_layout.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(Clone, Copy, imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] union Zst { a: (), } @@ -20,6 +21,7 @@ union Zst { util_assert_impl_all!(Zst: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] union One { a: bool, } @@ -27,6 +29,7 @@ union One { util_assert_impl_all!(One: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] union Two { a: bool, b: Zst, @@ -35,6 +38,7 @@ union Two { util_assert_impl_all!(Two: imp::KnownLayout); #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where I::Item: imp::Copy, @@ -52,6 +56,7 @@ util_assert_impl_all!(TypeParams<'static, (), imp::IntoIter<()>>: imp::KnownLayo // Deriving `imp::KnownLayout` should work if the union has bounded parameters. #[derive(imp::KnownLayout)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::KnownLayout, const N: usize> where diff --git a/zerocopy-derive/tests/union_no_cell.rs b/zerocopy-derive/tests/union_no_cell.rs index 46070fe914..246e9a3b71 100644 --- a/zerocopy-derive/tests/union_no_cell.rs +++ b/zerocopy-derive/tests/union_no_cell.rs @@ -13,6 +13,7 @@ include!("include.rs"); #[derive(Clone, Copy, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] union Zst { a: (), } @@ -20,6 +21,7 @@ union Zst { util_assert_impl_all!(Zst: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] union One { a: bool, } @@ -27,6 +29,7 @@ union One { util_assert_impl_all!(One: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] union Two { a: bool, b: Zst, @@ -35,6 +38,7 @@ union Two { util_assert_impl_all!(Two: imp::Immutable); #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where I::Item: imp::Copy, @@ -52,6 +56,7 @@ util_assert_impl_all!(TypeParams<'static, (), imp::IntoIter<()>>: imp::Immutable // Deriving `imp::Immutable` should work if the union has bounded parameters. #[derive(imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::Immutable, const N: usize> where diff --git a/zerocopy-derive/tests/union_to_bytes.rs b/zerocopy-derive/tests/union_to_bytes.rs index e1acba355d..c453822a00 100644 --- a/zerocopy-derive/tests/union_to_bytes.rs +++ b/zerocopy-derive/tests/union_to_bytes.rs @@ -19,6 +19,7 @@ include!("include.rs"); // - `repr(packed)` #[derive(imp::IntoBytes, Clone, Copy)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union CZst { a: (), @@ -27,6 +28,7 @@ union CZst { util_assert_impl_all!(CZst: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union C { a: u8, @@ -48,6 +50,7 @@ util_assert_impl_all!(C: imp::IntoBytes); // is_as_bytes!(Transparent); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] union CZstPacked { a: (), @@ -56,6 +59,7 @@ union CZstPacked { util_assert_impl_all!(CZstPacked: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] union CPacked { a: u8, @@ -65,6 +69,7 @@ union CPacked { util_assert_impl_all!(CPacked: imp::IntoBytes); #[derive(imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, packed)] union CMultibytePacked { a: i32, diff --git a/zerocopy-derive/tests/union_try_from_bytes.rs b/zerocopy-derive/tests/union_try_from_bytes.rs index 2fa72cc2ad..c5ef4dce9f 100644 --- a/zerocopy-derive/tests/union_try_from_bytes.rs +++ b/zerocopy-derive/tests/union_try_from_bytes.rs @@ -16,6 +16,7 @@ include!("include.rs"); // - any of its fields are `imp::TryFromBytes` #[derive(imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union One { a: u8, } @@ -29,6 +30,7 @@ fn one() { } #[derive(imp::Immutable, imp::TryFromBytes, imp::IntoBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union Two { a: bool, @@ -45,6 +47,7 @@ fn two() { } #[derive(imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union BoolAndZst { a: bool, @@ -59,6 +62,7 @@ fn bool_and_zst() { } #[derive(imp::FromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union MaybeFromBytes { t: T, @@ -74,6 +78,7 @@ fn test_maybe_from_bytes() { } #[derive(imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where @@ -94,6 +99,7 @@ util_assert_impl_all!(TypeParams<'static, [util::AU16; 2], imp::IntoIter<()>>: i // Deriving `imp::TryFromBytes` should work if the union has bounded parameters. #[derive(imp::Immutable, imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union WithParams<'a: 'b, 'b: 'a, T: 'a + 'b + imp::TryFromBytes, const N: usize> where @@ -108,9 +114,11 @@ where util_assert_impl_all!(WithParams<'static, 'static, u8, 42>: imp::TryFromBytes); #[derive(Clone, Copy, imp::TryFromBytes, imp::Immutable)] +#[zerocopy(crate = "zerocopy_renamed")] struct A; #[derive(imp::TryFromBytes)] +#[zerocopy(crate = "zerocopy_renamed")] union B { a: A, } diff --git a/zerocopy-derive/tests/union_unaligned.rs b/zerocopy-derive/tests/union_unaligned.rs index 49aaa9a076..5321afa826 100644 --- a/zerocopy-derive/tests/union_unaligned.rs +++ b/zerocopy-derive/tests/union_unaligned.rs @@ -19,6 +19,7 @@ include!("include.rs"); // - `repr(packed)` #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union Foo { a: imp::u8, @@ -36,8 +37,8 @@ util_assert_impl_all!(Foo: imp::Unaligned); // } // is_unaligned!(Bar); - #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(packed)] union Baz { // NOTE: The `u16` type is not guaranteed to have alignment 2, although it @@ -53,6 +54,7 @@ union Baz { util_assert_impl_all!(Baz: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C, align(1))] union FooAlign { a: imp::u8, @@ -61,6 +63,7 @@ union FooAlign { util_assert_impl_all!(FooAlign: imp::Unaligned); #[derive(imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] union TypeParams<'a, T: imp::Copy, I: imp::Iterator> where diff --git a/zerocopy-derive/tests/unsafe_cell.rs b/zerocopy-derive/tests/unsafe_cell.rs index 7f6d8b7a6c..d0857bb377 100644 --- a/zerocopy-derive/tests/unsafe_cell.rs +++ b/zerocopy-derive/tests/unsafe_cell.rs @@ -19,14 +19,17 @@ include!("include.rs"); // non-trivial impl, which deriving `FromZeros` accomplishes. #[derive(imp::FromBytes, imp::IntoBytes, imp::KnownLayout, imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct StructFromBytes(imp::UnsafeCell); #[derive(imp::FromZeros, imp::IntoBytes, imp::KnownLayout, imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(C)] struct StructFromZeros(imp::UnsafeCell); #[derive(imp::FromZeros, imp::IntoBytes, imp::KnownLayout, imp::Unaligned)] +#[zerocopy(crate = "zerocopy_renamed")] #[repr(u8)] enum EnumFromZeros { A(imp::UnsafeCell),