From 407d5d3e42ddfe2af9d01ea1fd82335bc446143e Mon Sep 17 00:00:00 2001 From: Aniket Barun Date: Sun, 13 Sep 2026 02:20:03 +0530 Subject: [PATCH 1/3] Add public constructors for SizeError and ValidityError Callers who know, out-of-band, that a conversion would fail due to incorrect source size or invalid source data currently have no way to construct a SizeError or ValidityError directly, and must instead perform a contrived failing conversion just to obtain one (see #3666). Make SizeError::new and ValidityError::new public so these errors can be constructed directly and forwarded via the existing From impls into ConvertError, TryReadError, etc. Fixes #3666 --- zerocopy/src/error.rs | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/zerocopy/src/error.rs b/zerocopy/src/error.rs index afdbc03829..3dedc6f469 100644 --- a/zerocopy/src/error.rs +++ b/zerocopy/src/error.rs @@ -436,7 +436,23 @@ pub struct SizeError { } impl SizeError { - pub(crate) fn new(src: Src) -> Self { + /// Constructs a new `SizeError`. + /// + /// This can be used to propagate a size error out of code which knows, + /// out-of-band, that a conversion would fail due to an incorrect source + /// size, without needing to actually perform a failing conversion just to + /// obtain the error. + /// + /// # Examples + /// + /// ``` + /// use zerocopy::error::{ConvertError, SizeError}; + /// + /// let err: SizeError<(), u32> = SizeError::new(()); + /// let err: ConvertError<(), SizeError<(), u32>, ()> = err.into(); + /// ``` + #[inline] + pub fn new(src: Src) -> Self { Self { src, _dst: SendSyncPhantomData::default() } } @@ -595,7 +611,24 @@ pub struct ValidityError { } impl ValidityError { - pub(crate) fn new(src: Src) -> Self { + /// Constructs a new `ValidityError`. + /// + /// This can be used to propagate a validity error out of code which + /// knows, out-of-band, that a conversion would fail due to invalid + /// source data, without needing to actually perform a failing conversion + /// just to obtain the error. + /// + /// # Examples + /// + /// ``` + /// use zerocopy::error::{ConvertError, ValidityError}; + /// use zerocopy::FromBytes; + /// + /// let err: ValidityError<(), bool> = ValidityError::new(()); + /// let err: ConvertError<(), (), ValidityError<(), bool>> = err.into(); + /// ``` + #[inline] + pub fn new(src: Src) -> Self { Self { src, _dst: SendSyncPhantomData::default() } } From 4b8e24ce8d630e848cd4fe9bf88870b4cd9407f6 Mon Sep 17 00:00:00 2001 From: Aniket Barun Date: Sun, 13 Sep 2026 03:42:27 +0530 Subject: [PATCH 2/3] Update UI test stderr snapshots for shifted error.rs line numbers Adding rustdoc to SizeError::new shifted every line below it in error.rs down by 16, including the ValidityError struct definition whose TryFromBytes bound is cited by rustc in trybuild UI test snapshots (try_transmute[.mut/.ref].{msrv,stable,nightly}.stderr). Update the embedded line number from 590 to 606 to match. --- zerocopy/tests/ui/try_transmute.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute.stable.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.stable.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.stable.stderr | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/zerocopy/tests/ui/try_transmute.msrv.stderr b/zerocopy/tests/ui/try_transmute.msrv.stderr index dacbbe8e23..3b8c7f579a 100644 --- a/zerocopy/tests/ui/try_transmute.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute.msrv.stderr @@ -18,7 +18,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -30,7 +30,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute.nightly.stderr b/zerocopy/tests/ui/try_transmute.nightly.stderr index 8ac099d9b9..dd61dac868 100644 --- a/zerocopy/tests/ui/try_transmute.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute.nightly.stderr @@ -21,7 +21,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -85,7 +85,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute.stable.stderr b/zerocopy/tests/ui/try_transmute.stable.stderr index e6aa785ee9..3252f1db9f 100644 --- a/zerocopy/tests/ui/try_transmute.stable.stderr +++ b/zerocopy/tests/ui/try_transmute.stable.stderr @@ -21,7 +21,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -85,7 +85,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_mut.msrv.stderr b/zerocopy/tests/ui/try_transmute_mut.msrv.stderr index 8b45a0d9c0..17e94be232 100644 --- a/zerocopy/tests/ui/try_transmute_mut.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.msrv.stderr @@ -21,7 +21,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -33,7 +33,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_mut.nightly.stderr b/zerocopy/tests/ui/try_transmute_mut.nightly.stderr index a260da6b05..0d4182a2c5 100644 --- a/zerocopy/tests/ui/try_transmute_mut.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.nightly.stderr @@ -87,7 +87,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -117,7 +117,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_mut.stable.stderr b/zerocopy/tests/ui/try_transmute_mut.stable.stderr index cad0ec8875..66107f08ff 100644 --- a/zerocopy/tests/ui/try_transmute_mut.stable.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.stable.stderr @@ -87,7 +87,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -117,7 +117,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_ref.msrv.stderr b/zerocopy/tests/ui/try_transmute_ref.msrv.stderr index 32afc9e209..96b32896cb 100644 --- a/zerocopy/tests/ui/try_transmute_ref.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.msrv.stderr @@ -44,7 +44,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -56,7 +56,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy` | note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_ref.nightly.stderr b/zerocopy/tests/ui/try_transmute_ref.nightly.stderr index 4401e6fc19..5a1d920b6c 100644 --- a/zerocopy/tests/ui/try_transmute_ref.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.nightly.stderr @@ -106,7 +106,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -136,7 +136,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> src/error.rs:590:45 + --> src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` diff --git a/zerocopy/tests/ui/try_transmute_ref.stable.stderr b/zerocopy/tests/ui/try_transmute_ref.stable.stderr index de3630c06e..46e07b2ea2 100644 --- a/zerocopy/tests/ui/try_transmute_ref.stable.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.stable.stderr @@ -106,7 +106,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` @@ -136,7 +136,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` (A, B, C, D, E, F, G, H) and $OTHER_TYPES others note: required by a bound in `ValidityError` - --> $WORKSPACE/src/error.rs:590:45 + --> $WORKSPACE/src/error.rs:606:45 | 590 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` From a2fd6bd440582795caf368d1d28ea0d601918c51 Mon Sep 17 00:00:00 2001 From: Aniket Barun Date: Sun, 13 Sep 2026 03:55:46 +0530 Subject: [PATCH 3/3] Fix remaining stale line number in UI test stderr snapshots The previous fix updated the '--> src/error.rs:590:45' pointer line but missed the quoted source excerpt line ('590 | pub struct ValidityError...') that rustc also embeds in the same diagnostic. Update it to 606 as well. --- zerocopy/tests/ui/try_transmute.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute.stable.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_mut.stable.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.msrv.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.nightly.stderr | 4 ++-- zerocopy/tests/ui/try_transmute_ref.stable.stderr | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/zerocopy/tests/ui/try_transmute.msrv.stderr b/zerocopy/tests/ui/try_transmute.msrv.stderr index 3b8c7f579a..08b62ffc62 100644 --- a/zerocopy/tests/ui/try_transmute.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute.msrv.stderr @@ -20,7 +20,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied @@ -32,7 +32,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy/tests/ui/try_transmute.nightly.stderr b/zerocopy/tests/ui/try_transmute.nightly.stderr index dd61dac868..62dc42f3e4 100644 --- a/zerocopy/tests/ui/try_transmute.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute.nightly.stderr @@ -23,7 +23,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -87,7 +87,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console diff --git a/zerocopy/tests/ui/try_transmute.stable.stderr b/zerocopy/tests/ui/try_transmute.stable.stderr index 3252f1db9f..860cddff90 100644 --- a/zerocopy/tests/ui/try_transmute.stable.stderr +++ b/zerocopy/tests/ui/try_transmute.stable.stderr @@ -23,7 +23,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -87,7 +87,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console diff --git a/zerocopy/tests/ui/try_transmute_mut.msrv.stderr b/zerocopy/tests/ui/try_transmute_mut.msrv.stderr index 17e94be232..1b87bc8d46 100644 --- a/zerocopy/tests/ui/try_transmute_mut.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.msrv.stderr @@ -23,7 +23,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied @@ -35,7 +35,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy/tests/ui/try_transmute_mut.nightly.stderr b/zerocopy/tests/ui/try_transmute_mut.nightly.stderr index 0d4182a2c5..06689ec6f1 100644 --- a/zerocopy/tests/ui/try_transmute_mut.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.nightly.stderr @@ -89,7 +89,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -119,7 +119,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console diff --git a/zerocopy/tests/ui/try_transmute_mut.stable.stderr b/zerocopy/tests/ui/try_transmute_mut.stable.stderr index 66107f08ff..54f9d89754 100644 --- a/zerocopy/tests/ui/try_transmute_mut.stable.stderr +++ b/zerocopy/tests/ui/try_transmute_mut.stable.stderr @@ -89,7 +89,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -119,7 +119,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console diff --git a/zerocopy/tests/ui/try_transmute_ref.msrv.stderr b/zerocopy/tests/ui/try_transmute_ref.msrv.stderr index 96b32896cb..7347c5441e 100644 --- a/zerocopy/tests/ui/try_transmute_ref.msrv.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.msrv.stderr @@ -46,7 +46,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied @@ -58,7 +58,7 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/zerocopy/tests/ui/try_transmute_ref.nightly.stderr b/zerocopy/tests/ui/try_transmute_ref.nightly.stderr index 5a1d920b6c..af3c345f9d 100644 --- a/zerocopy/tests/ui/try_transmute_ref.nightly.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.nightly.stderr @@ -108,7 +108,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -138,7 +138,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console diff --git a/zerocopy/tests/ui/try_transmute_ref.stable.stderr b/zerocopy/tests/ui/try_transmute_ref.stable.stderr index 46e07b2ea2..501c6e41ab 100644 --- a/zerocopy/tests/ui/try_transmute_ref.stable.stderr +++ b/zerocopy/tests/ui/try_transmute_ref.stable.stderr @@ -108,7 +108,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console @@ -138,7 +138,7 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy` note: required by a bound in `ValidityError` --> $WORKSPACE/src/error.rs:606:45 | -590 | pub struct ValidityError { +606 | pub struct ValidityError { | ^^^^^^^^^^^^ required by this bound in `ValidityError` = note: the full name for the type has been written to '/long-type-HASH.txt' = note: consider using `--verbose` to print the full type name to the console