diff --git a/Cargo.toml b/Cargo.toml index 62b73e77e37..688fe15c462 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ [package] edition = "2018" name = "zerocopy" -version = "0.7.32" +version = "0.7.33" authors = ["Joshua Liebow-Feeser "] description = "Utilities for zero-copy parsing and serialization" license = "BSD-2-Clause OR Apache-2.0 OR MIT" @@ -30,8 +30,8 @@ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"] [package.metadata.ci] # The versions of the stable and nightly compiler toolchains to use in CI. -pinned-stable = "1.74.0" -pinned-nightly = "nightly-2023-12-05" +pinned-stable = "1.78.0" +pinned-nightly = "nightly-2024-05-02" [package.metadata.playground] features = ["__internal_use_only_features_that_work_on_stable"] @@ -49,7 +49,7 @@ simd-nightly = ["simd"] __internal_use_only_features_that_work_on_stable = ["alloc", "derive", "simd"] [dependencies] -zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive", optional = true } +zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive", optional = true } [dependencies.byteorder] version = "1.3" @@ -60,7 +60,7 @@ optional = true # zerocopy-derive remain equal, even if the 'derive' feature isn't used. # See: https://github.com/matklad/macro-dep-test [target.'cfg(any())'.dependencies] -zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" } +zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive" } [dev-dependencies] assert_matches = "1.5" @@ -75,6 +75,6 @@ testutil = { path = "testutil" } # CI test failures. trybuild = { version = "=1.0.85", features = ["diff"] } # In tests, unlike in production, zerocopy-derive is not optional -zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" } +zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive" } # TODO(#381) Remove this dependency once we have our own layout gadgets. elain = "0.3.0" diff --git a/src/byteorder.rs b/src/byteorder.rs index 2769410451e..376c9810414 100644 --- a/src/byteorder.rs +++ b/src/byteorder.rs @@ -653,6 +653,7 @@ mod tests { use compatibility::*; // A native integer type (u16, i32, etc). + #[cfg_attr(kani, allow(dead_code))] trait Native: Arbitrary + FromBytes + AsBytes + Copy + PartialEq + Debug { const ZERO: Self; const MAX_VALUE: Self; @@ -664,11 +665,6 @@ mod tests { rng.sample(Self::DIST) } - #[cfg(kani)] - fn any() -> Self { - kani::any() - } - fn checked_add(self, rhs: Self) -> Option; fn checked_div(self, rhs: Self) -> Option; fn checked_mul(self, rhs: Self) -> Option; diff --git a/src/lib.rs b/src/lib.rs index 1e826439ff5..ff2e0d0c374 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -153,12 +153,11 @@ // `unknown_lints` is `warn` by default and we deny warnings in CI, so without // this attribute, any unknown lint would cause a CI failure when testing with // our MSRV. -#![allow(unknown_lints)] +#![allow(unknown_lints, non_local_definitions)] #![deny(renamed_and_removed_lints)] #![deny( anonymous_parameters, deprecated_in_future, - illegal_floating_point_literal_pattern, late_bound_lifetime_arguments, missing_copy_implementations, missing_debug_implementations, @@ -228,7 +227,18 @@ clippy::indexing_slicing, ))] #![cfg_attr(not(test), no_std)] -#![cfg_attr(feature = "simd-nightly", feature(stdsimd))] +#![cfg_attr( + all(feature = "simd-nightly", any(target_arch = "x86", target_arch = "x86_64")), + feature(stdarch_x86_avx512) +)] +#![cfg_attr( + all(feature = "simd-nightly", target_arch = "arm"), + feature(stdarch_arm_dsp, stdarch_arm_neon_intrinsics) +)] +#![cfg_attr( + all(feature = "simd-nightly", any(target_arch = "powerpc", target_arch = "powerpc64")), + feature(stdarch_powerpc) +)] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![cfg_attr( __INTERNAL_USE_ONLY_NIGHLTY_FEATURES_IN_TESTS, @@ -5126,9 +5136,7 @@ mod sealed { not(feature = "alloc"), doc = "[`Vec`]: https://doc.rust-lang.org/std/vec/struct.Vec.html" )] -pub unsafe trait ByteSlice: - Deref + Sized + self::sealed::ByteSliceSealed -{ +pub unsafe trait ByteSlice: Deref + Sized + sealed::ByteSliceSealed { /// Are the [`Ref::into_ref`] and [`Ref::into_mut`] methods sound when used /// with `Self`? If not, evaluating this constant must panic at compile /// time. @@ -6413,6 +6421,7 @@ mod tests { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | N | N | Y | KL01 | #[derive(KnownLayout)] + #[allow(dead_code)] // fields are never read struct KL01(NotKnownLayout, NotKnownLayout); let expected = DstLayout::for_type::(); @@ -6423,6 +6432,7 @@ mod tests { // ...with `align(N)`: #[derive(KnownLayout)] #[repr(align(64))] + #[allow(dead_code)] // fields are never read struct KL01Align(NotKnownLayout, NotKnownLayout); let expected = DstLayout::for_type::(); @@ -6433,6 +6443,7 @@ mod tests { // ...with `packed`: #[derive(KnownLayout)] #[repr(packed)] + #[allow(dead_code)] // fields are never read struct KL01Packed(NotKnownLayout, NotKnownLayout); let expected = DstLayout::for_type::(); @@ -6443,6 +6454,7 @@ mod tests { // ...with `packed(N)`: #[derive(KnownLayout)] #[repr(packed(2))] + #[allow(dead_code)] // fields are never read struct KL01PackedN(NotKnownLayout, NotKnownLayout); assert_impl_all!(KL01PackedN: KnownLayout); @@ -6455,6 +6467,7 @@ mod tests { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | N | Y | Y | KL03 | #[derive(KnownLayout)] + #[allow(dead_code)] // fields are never read struct KL03(NotKnownLayout, u8); let expected = DstLayout::for_type::(); @@ -6465,6 +6478,7 @@ mod tests { // ... with `align(N)` #[derive(KnownLayout)] #[repr(align(64))] + #[allow(dead_code)] // fields are never read struct KL03Align(NotKnownLayout, u8); let expected = DstLayout::for_type::(); @@ -6475,6 +6489,7 @@ mod tests { // ... with `packed`: #[derive(KnownLayout)] #[repr(packed)] + #[allow(dead_code)] // fields are never read struct KL03Packed(NotKnownLayout, u8); let expected = DstLayout::for_type::(); @@ -6485,6 +6500,7 @@ mod tests { // ... with `packed(N)` #[derive(KnownLayout)] #[repr(packed(2))] + #[allow(dead_code)] // fields are never read struct KL03PackedN(NotKnownLayout, u8); assert_impl_all!(KL03PackedN: KnownLayout); @@ -6497,6 +6513,7 @@ mod tests { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | Y | N | Y | KL05 | #[derive(KnownLayout)] + #[allow(dead_code)] // fields are never read struct KL05(u8, T); fn _test_kl05(t: T) -> impl KnownLayout { @@ -6506,6 +6523,7 @@ mod tests { // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name | // | N | Y | Y | Y | KL07 | #[derive(KnownLayout)] + #[allow(dead_code)] // fields are never read struct KL07(u8, T); fn _test_kl07(t: T) -> impl KnownLayout { @@ -7656,6 +7674,7 @@ mod tests { fn test_transparent_packed_generic_struct() { #[derive(AsBytes, FromZeroes, FromBytes, Unaligned)] #[repr(transparent)] + #[allow(dead_code)] // for the unused fields struct Foo { _t: T, _phantom: PhantomData<()>, @@ -7666,6 +7685,7 @@ mod tests { #[derive(AsBytes, FromZeroes, FromBytes, Unaligned)] #[repr(packed)] + #[allow(dead_code)] // for the unused fields struct Bar { _t: T, _u: U, diff --git a/src/macro_util.rs b/src/macro_util.rs index 24fec4f0157..52fc0740704 100644 --- a/src/macro_util.rs +++ b/src/macro_util.rs @@ -478,6 +478,7 @@ mod tests { macro_rules! test { (#[$cfg:meta] ($($ts:ty),* ; $trailing_field_ty:ty) => $expect:expr) => {{ #[$cfg] + #[allow(dead_code)] // fields are never read struct Test($($ts,)* $trailing_field_ty); assert_eq!(test!(@offset $($ts),* ; $trailing_field_ty), $expect); }}; @@ -617,6 +618,7 @@ mod tests { macro_rules! test { (#[$cfg:meta] ($($ts:ty),*) => $expect:expr) => {{ #[$cfg] + #[allow(dead_code)] // fields are never read struct Test($($ts),*); assert_eq!(struct_has_padding!(Test, $($ts),*), $expect); }}; diff --git a/src/util.rs b/src/util.rs index b35cc079c13..50cad1f6da2 100644 --- a/src/util.rs +++ b/src/util.rs @@ -652,10 +652,12 @@ pub(crate) mod polyfills { // MSRV is 1.70, when that function was stabilized. // // TODO(#67): Once our MSRV is 1.70, remove this. + #[allow(unused)] pub(crate) trait NonNullExt { fn slice_from_raw_parts(data: Self, len: usize) -> NonNull<[T]>; } + #[allow(unused)] impl NonNullExt for NonNull { #[inline(always)] fn slice_from_raw_parts(data: Self, len: usize) -> NonNull<[T]> { diff --git a/src/wrappers.rs b/src/wrappers.rs index 532d8729789..6532bb46342 100644 --- a/src/wrappers.rs +++ b/src/wrappers.rs @@ -134,7 +134,7 @@ impl Unalign { /// may prefer [`Deref::deref`], which is infallible. #[inline(always)] pub fn try_deref(&self) -> Option<&T> { - if !crate::util::aligned_to::<_, T>(self) { + if !util::aligned_to::<_, T>(self) { return None; } @@ -154,7 +154,7 @@ impl Unalign { /// callers may prefer [`DerefMut::deref_mut`], which is infallible. #[inline(always)] pub fn try_deref_mut(&mut self) -> Option<&mut T> { - if !crate::util::aligned_to::<_, T>(&*self) { + if !util::aligned_to::<_, T>(&*self) { return None; } diff --git a/tests/ui-nightly/include_value_not_from_bytes.stderr b/tests/ui-nightly/include_value_not_from_bytes.stderr index d948a0db813..f7c7fdd7a89 100644 --- a/tests/ui-nightly/include_value_not_from_bytes.stderr +++ b/tests/ui-nightly/include_value_not_from_bytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `UnsafeCell: FromBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others note: required by a bound in `AssertIsFromBytes` --> tests/ui-nightly/include_value_not_from_bytes.rs:12:5 diff --git a/tests/ui-nightly/invalid-impls/invalid-impls.stderr b/tests/ui-nightly/invalid-impls/invalid-impls.stderr index e5651d169e0..1c913094b1c 100644 --- a/tests/ui-nightly/invalid-impls/invalid-impls.stderr +++ b/tests/ui-nightly/invalid-impls/invalid-impls.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: zerocopy::FromZeroes` is not satisfied --> tests/ui-nightly/invalid-impls/invalid-impls.rs:26:37 | 26 | impl_or_verify!(T => FromZeroes for Foo); - | ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T`, which is required by `Foo: zerocopy::FromZeroes` | note: required for `Foo` to implement `zerocopy::FromZeroes` --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:10 @@ -29,7 +29,7 @@ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied --> tests/ui-nightly/invalid-impls/invalid-impls.rs:27:36 | 27 | impl_or_verify!(T => FromBytes for Foo); - | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T`, which is required by `Foo: zerocopy::FromBytes` | note: required for `Foo` to implement `zerocopy::FromBytes` --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:22 @@ -56,7 +56,7 @@ error[E0277]: the trait bound `T: zerocopy::AsBytes` is not satisfied --> tests/ui-nightly/invalid-impls/invalid-impls.rs:28:34 | 28 | impl_or_verify!(T => AsBytes for Foo); - | ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T`, which is required by `Foo: zerocopy::AsBytes` | note: required for `Foo` to implement `zerocopy::AsBytes` --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:33 @@ -83,7 +83,7 @@ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied --> tests/ui-nightly/invalid-impls/invalid-impls.rs:29:36 | 29 | impl_or_verify!(T => Unaligned for Foo); - | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T`, which is required by `Foo: zerocopy::Unaligned` | note: required for `Foo` to implement `zerocopy::Unaligned` --> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:42 diff --git a/tests/ui-nightly/max-align.stderr b/tests/ui-nightly/max-align.stderr index 0cadb9a99a4..c11eed539e5 100644 --- a/tests/ui-nightly/max-align.stderr +++ b/tests/ui-nightly/max-align.stderr @@ -1,5 +1,5 @@ error[E0589]: invalid `repr(align)` attribute: larger than 2^29 - --> tests/ui-nightly/max-align.rs:96:11 + --> tests/ui-nightly/max-align.rs:96:17 | 96 | #[repr(C, align(1073741824))] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ diff --git a/tests/ui-nightly/transmute-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-dst-not-frombytes.stderr index a9f1f7becf8..70bec216338 100644 --- a/tests/ui-nightly/transmute-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-dst-not-frombytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsFromBytes` --> tests/ui-nightly/transmute-dst-not-frombytes.rs:18:41 diff --git a/tests/ui-nightly/transmute-mut-const.stderr b/tests/ui-nightly/transmute-mut-const.stderr index fa53ed09a9b..6361421e019 100644 --- a/tests/ui-nightly/transmute-mut-const.stderr +++ b/tests/ui-nightly/transmute-mut-const.stderr @@ -21,6 +21,7 @@ error[E0658]: mutable references are not allowed in constants | = note: see issue #57349 for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + = note: this compiler was built on 2024-05-01; consider upgrading it if it is out of date error[E0015]: cannot call non-const fn `transmute_mut::<'_, '_, [u8; 2], [u8; 2]>` in constants --> tests/ui-nightly/transmute-mut-const.rs:20:37 @@ -30,13 +31,3 @@ error[E0015]: cannot call non-const fn `transmute_mut::<'_, '_, [u8; 2], [u8; 2] | = note: calls in constants are limited to constant functions, tuple structs and tuple variants = 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-nightly/transmute-mut-const.rs:20:57 - | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); - | --------------------^^^^^^^^^^^^- - | | | - | | creates a temporary value which is freed while still in use - | temporary value is freed at the end of this statement - | using this value as a constant requires that borrow lasts for `'static` diff --git a/tests/ui-nightly/transmute-mut-dst-not-asbytes.stderr b/tests/ui-nightly/transmute-mut-dst-not-asbytes.stderr index 54c8e6023f2..7de5da60adb 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-asbytes.stderr +++ b/tests/ui-nightly/transmute-mut-dst-not-asbytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `Dst: AsBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others note: required by a bound in `AssertDstIsAsBytes` --> tests/ui-nightly/transmute-mut-dst-not-asbytes.rs:24:36 diff --git a/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr index ea2123bc0b0..9df4ebc2ba8 100644 --- a/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `Dst: FromBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others note: required by a bound in `AssertDstIsFromBytes` --> tests/ui-nightly/transmute-mut-dst-not-frombytes.rs:24:38 diff --git a/tests/ui-nightly/transmute-mut-dst-unsized.stderr b/tests/ui-nightly/transmute-mut-dst-unsized.stderr index a670e250133..5e3fbb4bfc0 100644 --- a/tests/ui-nightly/transmute-mut-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-dst-unsized.stderr @@ -50,11 +50,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -64,11 +64,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -78,9 +78,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-nightly/transmute-mut-src-dst-unsized.stderr b/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr index 0f41a420eb6..2fe66581f5a 100644 --- a/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-src-dst-unsized.stderr @@ -139,11 +139,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -153,11 +153,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -167,11 +167,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -192,11 +192,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -209,11 +209,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `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 size for values of type `[u8]` cannot be known at compilation time @@ -223,9 +223,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-nightly/transmute-mut-src-not-asbytes.stderr b/tests/ui-nightly/transmute-mut-src-not-asbytes.stderr index b755d3c6542..0b4154b1b94 100644 --- a/tests/ui-nightly/transmute-mut-src-not-asbytes.stderr +++ b/tests/ui-nightly/transmute-mut-src-not-asbytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `Src: AsBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + Dst + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertSrcIsAsBytes` --> tests/ui-nightly/transmute-mut-src-not-asbytes.rs:24:36 @@ -31,14 +31,14 @@ error[E0277]: the trait bound `Src: AsBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `Src` | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + Dst + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertSrcIsAsBytes` --> tests/ui-nightly/transmute-mut-src-not-asbytes.rs:24:36 diff --git a/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr b/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr index 5a9f0a7a7fd..858fc50951d 100644 --- a/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + Dst + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertSrcIsFromBytes` --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:24:38 @@ -31,14 +31,14 @@ error[E0277]: the trait bound `Src: FromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `Src` | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + Dst + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertSrcIsFromBytes` --> tests/ui-nightly/transmute-mut-src-not-frombytes.rs:24:38 diff --git a/tests/ui-nightly/transmute-mut-src-unsized.stderr b/tests/ui-nightly/transmute-mut-src-unsized.stderr index 99475adee04..b8599942bda 100644 --- a/tests/ui-nightly/transmute-mut-src-unsized.stderr +++ b/tests/ui-nightly/transmute-mut-src-unsized.stderr @@ -105,11 +105,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -119,11 +119,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -133,11 +133,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -150,9 +150,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-nightly/transmute-ref-dst-not-frombytes.stderr b/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr index e4791d76b01..a09f99660d4 100644 --- a/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr +++ b/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsFromBytes` --> tests/ui-nightly/transmute-ref-dst-not-frombytes.rs:18:42 diff --git a/tests/ui-nightly/transmute-ref-dst-unsized.stderr b/tests/ui-nightly/transmute-ref-dst-unsized.stderr index 3d0f6d03001..1e97b5b0ef7 100644 --- a/tests/ui-nightly/transmute-ref-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-dst-unsized.stderr @@ -33,11 +33,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -47,11 +47,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -61,9 +61,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = 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-dst-unsized.stderr b/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr index 02e62bce0b3..cb1e443ac1c 100644 --- a/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-src-dst-unsized.stderr @@ -91,11 +91,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -105,11 +105,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -119,11 +119,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -144,11 +144,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -161,11 +161,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = note: this error originates in the macro `transmute_ref` (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 @@ -175,9 +175,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = 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-asbytes.stderr b/tests/ui-nightly/transmute-ref-src-not-asbytes.stderr index eb28ccf7c80..5ae6b5a524c 100644 --- a/tests/ui-nightly/transmute-ref-src-not-asbytes.stderr +++ b/tests/ui-nightly/transmute-ref-src-not-asbytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsAsBytes` --> tests/ui-nightly/transmute-ref-src-not-asbytes.rs:18:33 @@ -31,14 +31,14 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsAsBytes` --> tests/ui-nightly/transmute-ref-src-not-asbytes.rs:18:33 diff --git a/tests/ui-nightly/transmute-ref-src-unsized.stderr b/tests/ui-nightly/transmute-ref-src-unsized.stderr index b280429b03c..3ce31caf105 100644 --- a/tests/ui-nightly/transmute-ref-src-unsized.stderr +++ b/tests/ui-nightly/transmute-ref-src-unsized.stderr @@ -74,11 +74,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -88,11 +88,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -102,11 +102,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -119,9 +119,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = 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-src-not-asbytes.stderr b/tests/ui-nightly/transmute-src-not-asbytes.stderr index b36a8206867..20f1b18b9fc 100644 --- a/tests/ui-nightly/transmute-src-not-asbytes.stderr +++ b/tests/ui-nightly/transmute-src-not-asbytes.stderr @@ -8,14 +8,14 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied | required by a bound introduced by this call | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsAsBytes` --> tests/ui-nightly/transmute-src-not-asbytes.rs:18:32 @@ -31,14 +31,14 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required by a bound in `AssertIsAsBytes` --> tests/ui-nightly/transmute-src-not-asbytes.rs:18:32 diff --git a/tests/ui-stable/invalid-impls/invalid-impls.stderr b/tests/ui-stable/invalid-impls/invalid-impls.stderr index 7737d67175e..c7ba84b10a4 100644 --- a/tests/ui-stable/invalid-impls/invalid-impls.stderr +++ b/tests/ui-stable/invalid-impls/invalid-impls.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: zerocopy::FromZeroes` is not satisfied --> tests/ui-stable/invalid-impls/invalid-impls.rs:26:37 | 26 | impl_or_verify!(T => FromZeroes for Foo); - | ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T`, which is required by `Foo: zerocopy::FromZeroes` | note: required for `Foo` to implement `zerocopy::FromZeroes` --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:10 @@ -29,7 +29,7 @@ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied --> tests/ui-stable/invalid-impls/invalid-impls.rs:27:36 | 27 | impl_or_verify!(T => FromBytes for Foo); - | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T`, which is required by `Foo: zerocopy::FromBytes` | note: required for `Foo` to implement `zerocopy::FromBytes` --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:22 @@ -56,7 +56,7 @@ error[E0277]: the trait bound `T: zerocopy::AsBytes` is not satisfied --> tests/ui-stable/invalid-impls/invalid-impls.rs:28:34 | 28 | impl_or_verify!(T => AsBytes for Foo); - | ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T`, which is required by `Foo: zerocopy::AsBytes` | note: required for `Foo` to implement `zerocopy::AsBytes` --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:33 @@ -83,7 +83,7 @@ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied --> tests/ui-stable/invalid-impls/invalid-impls.rs:29:36 | 29 | impl_or_verify!(T => Unaligned for Foo); - | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T` + | ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T`, which is required by `Foo: zerocopy::Unaligned` | note: required for `Foo` to implement `zerocopy::Unaligned` --> tests/ui-stable/invalid-impls/invalid-impls.rs:22:42 diff --git a/tests/ui-stable/max-align.stderr b/tests/ui-stable/max-align.stderr index ea472f2df73..7e83b2f5ac3 100644 --- a/tests/ui-stable/max-align.stderr +++ b/tests/ui-stable/max-align.stderr @@ -1,5 +1,5 @@ error[E0589]: invalid `repr(align)` attribute: larger than 2^29 - --> tests/ui-stable/max-align.rs:96:11 + --> tests/ui-stable/max-align.rs:96:17 | 96 | #[repr(C, align(1073741824))] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ diff --git a/tests/ui-stable/transmute-mut-const.stderr b/tests/ui-stable/transmute-mut-const.stderr index a89ea675581..076dcf54acc 100644 --- a/tests/ui-stable/transmute-mut-const.stderr +++ b/tests/ui-stable/transmute-mut-const.stderr @@ -29,13 +29,3 @@ error[E0015]: cannot call non-const fn `transmute_mut::<'_, '_, [u8; 2], [u8; 2] | = note: calls in constants are limited to constant functions, tuple structs and tuple variants = 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-stable/transmute-mut-const.rs:20:57 - | -20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S); - | --------------------^^^^^^^^^^^^- - | | | - | | creates a temporary value which is freed while still in use - | temporary value is freed at the end of this statement - | using this value as a constant requires that borrow lasts for `'static` diff --git a/tests/ui-stable/transmute-mut-dst-unsized.stderr b/tests/ui-stable/transmute-mut-dst-unsized.stderr index 07727850cd6..19b88e75898 100644 --- a/tests/ui-stable/transmute-mut-dst-unsized.stderr +++ b/tests/ui-stable/transmute-mut-dst-unsized.stderr @@ -50,11 +50,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -64,33 +64,13 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-dst-unsized.rs:17:32 - | -17 | const DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8; 1]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-dst-unsized.rs:17:32 | @@ -98,9 +78,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-stable/transmute-mut-src-dst-unsized.stderr b/tests/ui-stable/transmute-mut-src-dst-unsized.stderr index 8cf76649eb1..0cb83620b5e 100644 --- a/tests/ui-stable/transmute-mut-src-dst-unsized.stderr +++ b/tests/ui-stable/transmute-mut-src-dst-unsized.stderr @@ -105,23 +105,6 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation = help: unsized locals are gated as an unstable feature = note: this error originates in the macro `transmute_mut` (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/transmute-mut-src-dst-unsized.rs:17:36 - | -17 | const SRC_DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` - --> $RUST/core/src/intrinsics.rs - | - | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` - = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-src-dst-unsized.rs:17:36 | @@ -156,31 +139,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-src-dst-unsized.rs:17:36 - | -17 | const SRC_DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -190,11 +153,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -204,11 +167,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -229,11 +192,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -246,31 +209,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-src-dst-unsized.rs:17:36 - | -17 | const SRC_DST_UNSIZED: &mut [u8] = transmute_mut!(&mut [0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `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 size for values of type `[u8]` cannot be known at compilation time @@ -280,9 +223,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-stable/transmute-mut-src-unsized.stderr b/tests/ui-stable/transmute-mut-src-unsized.stderr index 7f6def929d3..07069ec6597 100644 --- a/tests/ui-stable/transmute-mut-src-unsized.stderr +++ b/tests/ui-stable/transmute-mut-src-unsized.stderr @@ -71,23 +71,6 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation = help: unsized locals are gated as an unstable feature = note: this error originates in the macro `transmute_mut` (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/transmute-mut-src-unsized.rs:16:35 - | -16 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` - --> $RUST/core/src/intrinsics.rs - | - | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` - = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-src-unsized.rs:16:35 | @@ -122,31 +105,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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/transmute-mut-src-unsized.rs:16:35 - | -16 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -156,11 +119,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -170,11 +133,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_mut` (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 @@ -187,9 +150,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_mut` +note: required by an implicit `Sized` bound in `transmute_mut` --> src/macro_util.rs | | pub unsafe fn transmute_mut<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_mut` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_mut` = 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-stable/transmute-ref-dst-unsized.stderr b/tests/ui-stable/transmute-ref-dst-unsized.stderr index 8a0c761466a..71cae85011d 100644 --- a/tests/ui-stable/transmute-ref-dst-unsized.stderr +++ b/tests/ui-stable/transmute-ref-dst-unsized.stderr @@ -33,11 +33,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -47,33 +47,13 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-dst-unsized.rs:17:28 - | -17 | const DST_UNSIZED: &[u8] = transmute_ref!(&[0u8; 1]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-dst-unsized.rs:17:28 | @@ -81,9 +61,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = 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-dst-unsized.stderr b/tests/ui-stable/transmute-ref-src-dst-unsized.stderr index ca62fcf7dbc..7017c2f8f6c 100644 --- a/tests/ui-stable/transmute-ref-src-dst-unsized.stderr +++ b/tests/ui-stable/transmute-ref-src-dst-unsized.stderr @@ -57,23 +57,6 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation = help: unsized locals are gated as an unstable feature = note: this error originates in the macro `transmute_ref` (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/transmute-ref-src-dst-unsized.rs:17:32 - | -17 | const SRC_DST_UNSIZED: &[u8] = transmute_ref!(&[0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` - --> $RUST/core/src/intrinsics.rs - | - | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` - = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-src-dst-unsized.rs:17:32 | @@ -108,31 +91,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-src-dst-unsized.rs:17:32 - | -17 | const SRC_DST_UNSIZED: &[u8] = transmute_ref!(&[0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -142,11 +105,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -156,11 +119,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -181,11 +144,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` +note: required by an implicit `Sized` bound in `transmute` --> $RUST/core/src/intrinsics.rs | | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute` = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -198,31 +161,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-src-dst-unsized.rs:17:32 - | -17 | const SRC_DST_UNSIZED: &[u8] = transmute_ref!(&[0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = note: this error originates in the macro `transmute_ref` (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 @@ -232,9 +175,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = 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 b194d674739..73984d0416d 100644 --- a/tests/ui-stable/transmute-ref-src-unsized.stderr +++ b/tests/ui-stable/transmute-ref-src-unsized.stderr @@ -40,23 +40,6 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation = help: unsized locals are gated as an unstable feature = note: this error originates in the macro `transmute_ref` (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/transmute-ref-src-unsized.rs:16:31 - | -16 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute` - --> $RUST/core/src/intrinsics.rs - | - | pub fn transmute(src: Src) -> Dst; - | ^^^ required by this bound in `transmute` - = note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-src-unsized.rs:16:31 | @@ -91,31 +74,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` - = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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/transmute-ref-src-unsized.rs:16:31 - | -16 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | doesn't have a size known at compile-time - | required by a bound introduced by this call - | - = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf::::new` - --> src/macro_util.rs - | - | impl MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf::::new` - | #[inline(never)] // Make `missing_inline_in_public_items` happy. - | pub fn new(_t: T, _u: U) -> MaxAlignsOf { - | --- required by a bound in this associated function + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -125,11 +88,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `MaxAlignsOf` +note: required by an implicit `Sized` bound in `MaxAlignsOf` --> src/macro_util.rs | | pub union MaxAlignsOf { - | ^ required by this bound in `MaxAlignsOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `MaxAlignsOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -139,11 +102,11 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `AlignOf` +note: required by an implicit `Sized` bound in `AlignOf` --> src/macro_util.rs | | pub struct AlignOf { - | ^ required by this bound in `AlignOf` + | ^ required by the implicit `Sized` requirement on this type parameter in `AlignOf` = note: this error originates in the macro `$crate::assert_align_gt_eq` which comes from the expansion of the macro `transmute_ref` (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 @@ -156,9 +119,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by a bound in `transmute_ref` +note: required by an implicit `Sized` bound in `transmute_ref` --> src/macro_util.rs | | pub const unsafe fn transmute_ref<'dst, 'src: 'dst, Src: 'src, Dst: 'dst>( - | ^^^ required by this bound in `transmute_ref` + | ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute_ref` = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy-derive/Cargo.toml b/zerocopy-derive/Cargo.toml index 1033a35469e..4f7afe4c8f7 100644 --- a/zerocopy-derive/Cargo.toml +++ b/zerocopy-derive/Cargo.toml @@ -9,7 +9,7 @@ [package] edition = "2018" name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.33" authors = ["Joshua Liebow-Feeser "] description = "Custom derive for traits from the zerocopy crate" license = "BSD-2-Clause OR Apache-2.0 OR MIT" diff --git a/zerocopy-derive/src/lib.rs b/zerocopy-derive/src/lib.rs index 9af8a28a06a..e6e69984e06 100644 --- a/zerocopy-derive/src/lib.rs +++ b/zerocopy-derive/src/lib.rs @@ -815,10 +815,12 @@ fn print_all_errors(errors: Vec) -> proc_macro2::TokenStream { // A polyfill for `Option::then_some`, which was added after our MSRV. // // TODO(#67): Remove this once our MSRV is >= 1.62. +#[allow(unused)] trait BoolExt { fn then_some(self, t: T) -> Option; } +#[allow(unused)] impl BoolExt for bool { fn then_some(self, t: T) -> Option { if self { diff --git a/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr b/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr index f214877dfb5..86533b235aa 100644 --- a/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr +++ b/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr @@ -2,17 +2,17 @@ error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied --> tests/ui-nightly/derive_transparent.rs:37:18 | 37 | assert_impl_all!(TransparentStruct: FromZeroes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: FromZeroes` | = help: the following other types implement trait `FromZeroes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + *const T + *mut T + AU16 + F32 + F64 + I128 + I16 and $N others note: required for `TransparentStruct` to implement `FromZeroes` --> tests/ui-nightly/derive_transparent.rs:27:19 @@ -30,17 +30,17 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied --> tests/ui-nightly/derive_transparent.rs:38:18 | 38 | assert_impl_all!(TransparentStruct: FromBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: FromBytes` | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required for `TransparentStruct` to implement `FromBytes` --> tests/ui-nightly/derive_transparent.rs:27:31 @@ -58,17 +58,17 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied --> tests/ui-nightly/derive_transparent.rs:39:18 | 39 | assert_impl_all!(TransparentStruct: AsBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: AsBytes` | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + F32 + F64 + I128 + I16 + I32 + I64 and $N others note: required for `TransparentStruct` to implement `AsBytes` --> tests/ui-nightly/derive_transparent.rs:27:10 @@ -86,17 +86,17 @@ error[E0277]: the trait bound `NotZerocopy: Unaligned` is not satisfied --> tests/ui-nightly/derive_transparent.rs:40:18 | 40 | assert_impl_all!(TransparentStruct: Unaligned); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unaligned` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unaligned` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: Unaligned` | = help: the following other types implement trait `Unaligned`: - bool - i8 - u8 - TransparentStruct - U16 - U32 - U64 - U128 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others note: required for `TransparentStruct` to implement `Unaligned` --> tests/ui-nightly/derive_transparent.rs:27:42 diff --git a/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr b/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr index 3c45dc4e840..8d4e33896af 100644 --- a/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr @@ -13,18 +13,21 @@ error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied | ^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy` | = help: the following other types implement trait `FromZeroes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + *const T + *mut T + AU16 + F32 + F64 + FromZeroes1 + I128 and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `FromZeroes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:37:10 @@ -33,18 +36,21 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied | ^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` | = help: the following other types implement trait `FromBytes`: - isize - i8 - i16 - i32 - i64 - i128 - usize - u8 + () + AU16 + F32 + F64 + FromBytes1 + I128 + I16 + I32 and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `FromBytes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `FromBytes1: FromZeroes` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:37:10 @@ -53,14 +59,14 @@ error[E0277]: the trait bound `FromBytes1: FromZeroes` is not satisfied | ^^^^^^^^^ the trait `FromZeroes` is not implemented for `FromBytes1` | = help: the following other types implement trait `FromZeroes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + *const T + *mut T + AU16 + F32 + F64 + FromZeroes1 + I128 and $N others note: required by a bound in `FromBytes` --> $WORKSPACE/src/lib.rs @@ -76,18 +82,21 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied | ^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` | = help: the following other types implement trait `AsBytes`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + AU16 + AsBytes1 + F32 + F64 + I128 + I16 + I32 and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `AU16: Unaligned` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:56:10 @@ -96,18 +105,21 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | = help: the following other types implement trait `Unaligned`: - bool - i8 - u8 - Unaligned1 - Unaligned2 - Unaligned3 - U16 - U32 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `AU16: Unaligned` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:64:10 @@ -116,18 +128,21 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | = help: the following other types implement trait `Unaligned`: - bool - i8 - u8 - Unaligned1 - Unaligned2 - Unaligned3 - U16 - U32 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `AU16: Unaligned` is not satisfied --> tests/ui-nightly/late_compile_pass.rs:71:10 @@ -136,15 +151,18 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied | ^^^^^^^^^ the trait `Unaligned` is not implemented for `AU16` | = help: the following other types implement trait `Unaligned`: - bool - i8 - u8 - Unaligned1 - Unaligned2 - Unaligned3 - U16 - U32 + () + F32 + F64 + I128 + I16 + I32 + I64 + ManuallyDrop and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | diff --git a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr index 7fd758c8fe9..59172750243 100644 --- a/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied --> tests/ui-nightly/mid_compile_pass.rs:59:26 | 59 | fn test_kl13(t: T) -> impl KnownLayout { - | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T` + | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL13: KnownLayout` | note: required for `KL13` to implement `KnownLayout` --> tests/ui-nightly/mid_compile_pass.rs:55:10 @@ -83,7 +83,7 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied --> tests/ui-nightly/mid_compile_pass.rs:50:15 | 50 | assert_kl(kl) - | --------- ^^ the trait `KnownLayout` is not implemented for `T` + | --------- ^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL12: KnownLayout` | | | required by a bound introduced by this call | diff --git a/zerocopy-derive/tests/ui-nightly/struct.stderr b/zerocopy-derive/tests/ui-nightly/struct.stderr index c3abcbd182e..77e0d9e676c 100644 --- a/zerocopy-derive/tests/ui-nightly/struct.stderr +++ b/zerocopy-derive/tests/ui-nightly/struct.stderr @@ -48,15 +48,18 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation 31 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` + = help: within `KL00`, the trait `Sized` is not implemented for `[u8]`, which is required by `KL00: Sized` note: required because it appears within the type `KL00` --> tests/ui-nightly/struct.rs:32:8 | 32 | struct KL00(u8, NotKnownLayoutDst); | ^^^^ = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> tests/ui-nightly/struct.rs:36:10 @@ -64,15 +67,18 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation 36 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` + = help: within `KL02`, the trait `Sized` is not implemented for `[u8]`, which is required by `KL02: Sized` note: required because it appears within the type `KL02` --> tests/ui-nightly/struct.rs:37:8 | 37 | struct KL02(u8, [u8]); | ^^^^ = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `NotKnownLayoutDst: KnownLayout` is not satisfied --> tests/ui-nightly/struct.rs:41:10 @@ -81,18 +87,21 @@ error[E0277]: the trait bound `NotKnownLayoutDst: KnownLayout` is not satisfied | ^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `NotKnownLayoutDst` | = help: the following other types implement trait `KnownLayout`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + *const T + *mut T + AU16 + F32 + F64 + I128 + I16 and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `NotKnownLayout: KnownLayout` is not satisfied --> tests/ui-nightly/struct.rs:47:10 @@ -101,18 +110,21 @@ error[E0277]: the trait bound `NotKnownLayout: KnownLayout` is not satisfied | ^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `NotKnownLayout` | = help: the following other types implement trait `KnownLayout`: - bool - char - isize - i8 - i16 - i32 - i64 - i128 + () + *const T + *mut T + AU16 + F32 + F64 + I128 + I16 and $N others = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `HasPadding: ShouldBe` is not satisfied --> tests/ui-nightly/struct.rs:59:10 @@ -122,8 +134,11 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n | = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `HasPadding: ShouldBe` is not satisfied --> tests/ui-nightly/struct.rs:66:10 @@ -133,8 +148,11 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n | = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0587]: type has conflicting packed and align representation hints --> tests/ui-nightly/struct.rs:91:1 diff --git a/zerocopy-derive/tests/ui-nightly/union.stderr b/zerocopy-derive/tests/ui-nightly/union.stderr index afc4e8c18d6..ae510e835bc 100644 --- a/zerocopy-derive/tests/ui-nightly/union.stderr +++ b/zerocopy-derive/tests/ui-nightly/union.stderr @@ -38,8 +38,11 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n | = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable = note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +9 + #![feature(trivial_bounds)] + | error[E0587]: type has conflicting packed and align representation hints --> tests/ui-nightly/union.rs:59:1 diff --git a/zerocopy-derive/tests/ui-stable/derive_transparent.stderr b/zerocopy-derive/tests/ui-stable/derive_transparent.stderr index f24dd4866d4..b13fffec292 100644 --- a/zerocopy-derive/tests/ui-stable/derive_transparent.stderr +++ b/zerocopy-derive/tests/ui-stable/derive_transparent.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotZerocopy: FromZeroes` is not satisfied --> tests/ui-stable/derive_transparent.rs:37:18 | 37 | assert_impl_all!(TransparentStruct: FromZeroes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromZeroes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: FromZeroes` | = help: the following other types implement trait `FromZeroes`: bool @@ -30,7 +30,7 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied --> tests/ui-stable/derive_transparent.rs:38:18 | 38 | assert_impl_all!(TransparentStruct: FromBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: FromBytes` | = help: the following other types implement trait `FromBytes`: isize @@ -58,7 +58,7 @@ error[E0277]: the trait bound `NotZerocopy: AsBytes` is not satisfied --> tests/ui-stable/derive_transparent.rs:39:18 | 39 | assert_impl_all!(TransparentStruct: AsBytes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsBytes` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: AsBytes` | = help: the following other types implement trait `AsBytes`: bool @@ -86,17 +86,17 @@ error[E0277]: the trait bound `NotZerocopy: Unaligned` is not satisfied --> tests/ui-stable/derive_transparent.rs:40:18 | 40 | assert_impl_all!(TransparentStruct: Unaligned); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unaligned` is not implemented for `NotZerocopy` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unaligned` is not implemented for `NotZerocopy`, which is required by `TransparentStruct: Unaligned` | = help: the following other types implement trait `Unaligned`: bool i8 u8 TransparentStruct + NonZero + NonZero U16 U32 - U64 - U128 and $N others note: required for `TransparentStruct` to implement `Unaligned` --> tests/ui-stable/derive_transparent.rs:27:42 diff --git a/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr b/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr index 808054ab4d6..e16638be2e5 100644 --- a/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr @@ -99,8 +99,8 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied Unaligned1 Unaligned2 Unaligned3 - U16 - U32 + NonZero + NonZero and $N others = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -118,8 +118,8 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied Unaligned1 Unaligned2 Unaligned3 - U16 - U32 + NonZero + NonZero and $N others = help: see issue #48214 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -137,8 +137,8 @@ error[E0277]: the trait bound `AU16: Unaligned` is not satisfied Unaligned1 Unaligned2 Unaligned3 - U16 - U32 + NonZero + NonZero and $N others = 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-stable/mid_compile_pass.stderr b/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr index f39bcdb1705..ee7dcb96838 100644 --- a/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr +++ b/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied --> tests/ui-stable/mid_compile_pass.rs:59:26 | 59 | fn test_kl13(t: T) -> impl KnownLayout { - | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T` + | ^^^^^^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL13: KnownLayout` | note: required for `KL13` to implement `KnownLayout` --> tests/ui-stable/mid_compile_pass.rs:55:10 @@ -83,7 +83,7 @@ error[E0277]: the trait bound `T: KnownLayout` is not satisfied --> tests/ui-stable/mid_compile_pass.rs:50:15 | 50 | assert_kl(kl) - | --------- ^^ the trait `KnownLayout` is not implemented for `T` + | --------- ^^ the trait `KnownLayout` is not implemented for `T`, which is required by `KL12: KnownLayout` | | | required by a bound introduced by this call | diff --git a/zerocopy-derive/tests/ui-stable/struct.stderr b/zerocopy-derive/tests/ui-stable/struct.stderr index a93d7c45b0b..b4c003b1449 100644 --- a/zerocopy-derive/tests/ui-stable/struct.stderr +++ b/zerocopy-derive/tests/ui-stable/struct.stderr @@ -48,7 +48,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation 31 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` + = help: within `KL00`, the trait `Sized` is not implemented for `[u8]`, which is required by `KL00: Sized` note: required because it appears within the type `KL00` --> tests/ui-stable/struct.rs:32:8 | @@ -63,7 +63,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation 36 | #[derive(KnownLayout)] | ^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` + = help: within `KL02`, the trait `Sized` is not implemented for `[u8]`, which is required by `KL02: Sized` note: required because it appears within the type `KL02` --> tests/ui-stable/struct.rs:37:8 | @@ -116,7 +116,7 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n 59 | #[derive(AsBytes)] | ^^^^^^^ the trait `ShouldBe` is not implemented for `HasPadding` | - = help: the trait `ShouldBe` is implemented for `HasPadding` + = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 = note: this error originates in the derive macro `AsBytes` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -126,6 +126,12 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n 66 | #[derive(AsBytes)] | ^^^^^^^ the trait `ShouldBe` is not implemented for `HasPadding` | - = help: the trait `ShouldBe` is implemented for `HasPadding` + = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 = note: this error originates in the derive macro `AsBytes` (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:91:1 + | +91 | struct Unaligned3; + | ^^^^^^^^^^^^^^^^^ diff --git a/zerocopy-derive/tests/ui-stable/union.stderr b/zerocopy-derive/tests/ui-stable/union.stderr index 8d5cbbbd664..f7d6953beec 100644 --- a/zerocopy-derive/tests/ui-stable/union.stderr +++ b/zerocopy-derive/tests/ui-stable/union.stderr @@ -36,6 +36,12 @@ error[E0277]: the trait bound `HasPadding: ShouldBe` is n 30 | #[derive(AsBytes)] | ^^^^^^^ the trait `ShouldBe` is not implemented for `HasPadding` | - = help: the trait `ShouldBe` is implemented for `HasPadding` + = help: the trait `ShouldBe` is implemented for `HasPadding` = help: see issue #48214 = note: this error originates in the derive macro `AsBytes` (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:59:1 + | +59 | union Unaligned3 { + | ^^^^^^^^^^^^^^^^