Skip to content

Commit ed93a19

Browse files
authored
Account for alignment directives in derive(IntoBytes) (#3064)
This fixes #3063 by threading alignment directives into the padding check macros, and fixes #3067 by unconditionally emitting the padding check even in the absence of fields (thus ensuring that there exists a padding check into which alignment directives can be threaded). Fixes #3063, #3067 gherrit-pr-id: Gf18655827d1c30e4421c83579b962bf7aa453969
1 parent 8647029 commit ed93a19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+943
-243
lines changed

src/macros.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,8 @@ macro_rules! cryptocorrosion_derive_traits {
10971097
) => {
10981098
$crate::struct_padding!(
10991099
Self,
1100+
None,
1101+
None,
11001102
[
11011103
$($($tuple_field_ty),*)?
11021104
$($($field_ty),*)?
@@ -1179,6 +1181,8 @@ macro_rules! cryptocorrosion_derive_traits {
11791181
{
11801182
$crate::union_padding!(
11811183
Self,
1184+
None::<usize>,
1185+
None::<usize>,
11821186
[$($field_ty),*]
11831187
)
11841188
},

src/util/macro_util.rs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,12 @@ pub use __size_of::size_of;
329329
#[doc(hidden)] // `#[macro_export]` bypasses this module's `#[doc(hidden)]`.
330330
#[macro_export]
331331
macro_rules! struct_padding {
332-
($t:ty, [$($ts:ty),*]) => {
332+
($t:ty, $_align:expr, $_packed:expr, [$($ts:ty),*]) => {{
333+
// The `align` and `packed` directives can be ignored here. Regardless
334+
// of if and how they are set, comparing the size of `$t` to the sum of
335+
// its field sizes is a reliable indicator of the presence of padding.
333336
$crate::util::macro_util::size_of::<$t>() - (0 $(+ $crate::util::macro_util::size_of::<$ts>())*)
334-
};
337+
}};
335338
}
336339

337340
/// Does the `repr(C)` struct type `$t` have padding?
@@ -342,10 +345,10 @@ macro_rules! struct_padding {
342345
#[doc(hidden)] // `#[macro_export]` bypasses this module's `#[doc(hidden)]`.
343346
#[macro_export]
344347
macro_rules! repr_c_struct_has_padding {
345-
($t:ty, [$($ts:tt),*]) => {{
348+
($t:ty, $align:expr, $packed:expr, [$($ts:tt),*]) => {{
346349
let layout = $crate::DstLayout::for_repr_c_struct(
347-
$crate::util::macro_util::core_reexport::option::Option::None,
348-
$crate::util::macro_util::core_reexport::option::Option::None,
350+
$align,
351+
$packed,
349352
&[$($crate::repr_c_struct_has_padding!(@field $ts),)*]
350353
);
351354
layout.requires_static_padding() || layout.requires_dynamic_padding()
@@ -379,7 +382,10 @@ macro_rules! repr_c_struct_has_padding {
379382
#[doc(hidden)] // `#[macro_export]` bypasses this module's `#[doc(hidden)]`.
380383
#[macro_export]
381384
macro_rules! union_padding {
382-
($t:ty, [$($ts:ty),*]) => {{
385+
($t:ty, $_align:expr, $_packed:expr, [$($ts:ty),*]) => {{
386+
// The `align` and `packed` directives can be ignored here. Regardless
387+
// of if and how they are set, comparing the size of `$t` to each of its
388+
// field sizes is a reliable indicator of the presence of padding.
383389
let mut max = 0;
384390
$({
385391
let padding = $crate::util::macro_util::size_of::<$t>() - $crate::util::macro_util::size_of::<$ts>();
@@ -410,7 +416,14 @@ macro_rules! union_padding {
410416
#[doc(hidden)] // `#[macro_export]` bypasses this module's `#[doc(hidden)]`.
411417
#[macro_export]
412418
macro_rules! enum_padding {
413-
($t:ty, $disc:ty, $([$($ts:ty),*]),*) => {{
419+
($t:ty, $_align:expr, $packed:expr, $disc:ty, $([$($ts:ty),*]),*) => {{
420+
// The `align` and `packed` directives are irrelevant. `$align` can be
421+
// ignored because regardless of if and how it is set, comparing the
422+
// size of `$t` to each of its field sizes is a reliable indicator of
423+
// the presence of padding. `$packed` is irrelevant because it is
424+
// forbidden on enums.
425+
#[allow(clippy::as_conversions)]
426+
const _: [(); 1] = [(); $packed.is_none() as usize];
414427
let mut max = 0;
415428
$({
416429
let padding = $crate::util::macro_util::size_of::<$t>()
@@ -927,6 +940,8 @@ pub mod core_reexport {
927940

928941
#[cfg(test)]
929942
mod tests {
943+
use core::num::NonZeroUsize;
944+
930945
use crate::util::testutil::*;
931946

932947
#[cfg(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS)]
@@ -1125,7 +1140,7 @@ mod tests {
11251140
#[$cfg]
11261141
#[allow(dead_code)]
11271142
struct Test($($ts),*);
1128-
assert_eq!(struct_padding!(Test, [$($ts),*]), $expect);
1143+
assert_eq!(struct_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, [$($ts),*]), $expect);
11291144
}};
11301145
(#[$cfg:meta] $(#[$cfgs:meta])* ($($ts:ty),*) => $expect:expr) => {
11311146
test!(#[$cfg] ($($ts),*) => $expect);
@@ -1156,7 +1171,7 @@ mod tests {
11561171
#[repr(C)]
11571172
#[allow(dead_code)]
11581173
struct Test($($ts),*);
1159-
assert_eq!(repr_c_struct_has_padding!(Test, [$($ts),*]), $expect);
1174+
assert_eq!(repr_c_struct_has_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, [$($ts),*]), $expect);
11601175
}};
11611176
}
11621177

@@ -1192,7 +1207,7 @@ mod tests {
11921207
#[$cfg]
11931208
#[allow(unused)] // fields are never read
11941209
union Test{ $($fs: $ts),* }
1195-
assert_eq!(union_padding!(Test, [$($ts),*]), $expect);
1210+
assert_eq!(union_padding!(Test, None::<NonZeroUsize>, None::<usize>, [$($ts),*]), $expect);
11961211
}};
11971212
(#[$cfg:meta] $(#[$cfgs:meta])* {$($fs:ident: $ts:ty),*} => $expect:expr) => {
11981213
test!(#[$cfg] {$($fs: $ts),*} => $expect);
@@ -1231,7 +1246,7 @@ mod tests {
12311246
$($vs ($($ts),*),)*
12321247
}
12331248
assert_eq!(
1234-
enum_padding!(Test, $disc, $([$($ts),*]),*),
1249+
enum_padding!(Test, None::<NonZeroUsize>, None::<NonZeroUsize>, $disc, $([$($ts),*]),*),
12351250
$expect
12361251
);
12371252
}};

tests/ui/transmute_mut.msrv.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut
8282
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
8383
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&mut [u8], &mut [u8; 1]>` due to unsatisfied trait bounds
8484
|
85-
::: $WORKSPACE/src/util/macro_util.rs:679:1
85+
::: $WORKSPACE/src/util/macro_util.rs:692:1
8686
|
87-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
87+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
8888
| --------------------------------------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst`
8989
|
9090
= note: the following trait bounds were not satisfied:

tests/ui/transmute_mut.nightly.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ help: the trait `FromBytes` is not implemented for `DstA`
4141
(A, B, C, D, E, F, G, H)
4242
and 85 others
4343
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
44-
--> src/util/macro_util.rs:793:14
44+
--> src/util/macro_util.rs:806:14
4545
|
46-
790 | pub fn transmute_mut(self) -> &'a mut Dst
46+
803 | pub fn transmute_mut(self) -> &'a mut Dst
4747
| ------------- required by a bound in this associated function
4848
...
49-
793 | Dst: FromBytes + IntoBytes,
49+
806 | Dst: FromBytes + IntoBytes,
5050
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
5151
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
5252

@@ -73,12 +73,12 @@ help: the trait `IntoBytes` is not implemented for `DstB`
7373
AtomicIsize
7474
and 74 others
7575
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
76-
--> src/util/macro_util.rs:793:26
76+
--> src/util/macro_util.rs:806:26
7777
|
78-
790 | pub fn transmute_mut(self) -> &'a mut Dst
78+
803 | pub fn transmute_mut(self) -> &'a mut Dst
7979
| ------------- required by a bound in this associated function
8080
...
81-
793 | Dst: FromBytes + IntoBytes,
81+
806 | Dst: FromBytes + IntoBytes,
8282
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
8383
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
8484

@@ -149,12 +149,12 @@ help: the trait `FromBytes` is not implemented for `SrcC`
149149
(A, B, C, D, E, F, G, H)
150150
and 85 others
151151
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
152-
--> src/util/macro_util.rs:792:14
152+
--> src/util/macro_util.rs:805:14
153153
|
154-
790 | pub fn transmute_mut(self) -> &'a mut Dst
154+
803 | pub fn transmute_mut(self) -> &'a mut Dst
155155
| ------------- required by a bound in this associated function
156-
791 | where
157-
792 | Src: FromBytes + IntoBytes,
156+
804 | where
157+
805 | Src: FromBytes + IntoBytes,
158158
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
159159
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
160160

@@ -181,12 +181,12 @@ help: the trait `IntoBytes` is not implemented for `SrcD`
181181
AtomicIsize
182182
and 74 others
183183
note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
184-
--> src/util/macro_util.rs:792:26
184+
--> src/util/macro_util.rs:805:26
185185
|
186-
790 | pub fn transmute_mut(self) -> &'a mut Dst
186+
803 | pub fn transmute_mut(self) -> &'a mut Dst
187187
| ------------- required by a bound in this associated function
188-
791 | where
189-
792 | Src: FromBytes + IntoBytes,
188+
804 | where
189+
805 | Src: FromBytes + IntoBytes,
190190
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
191191
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
192192

@@ -196,9 +196,9 @@ error[E0599]: the method `transmute_mut` exists for struct `zerocopy::util::macr
196196
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
197197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198198
|
199-
::: src/util/macro_util.rs:679:1
199+
::: src/util/macro_util.rs:692:1
200200
|
201-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
201+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
202202
| ------------------------- doesn't satisfy `_: TransmuteMutDst<'_>`
203203
|
204204
= note: the following trait bounds were not satisfied:

tests/ui/transmute_mut.stable.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ help: the trait `FromBytes` is not implemented for `DstA`
4141
(A, B, C, D, E, F, G, H)
4242
and 85 others
4343
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
44-
--> $WORKSPACE/src/util/macro_util.rs:793:14
44+
--> $WORKSPACE/src/util/macro_util.rs:806:14
4545
|
46-
790 | pub fn transmute_mut(self) -> &'a mut Dst
46+
803 | pub fn transmute_mut(self) -> &'a mut Dst
4747
| ------------- required by a bound in this associated function
4848
...
49-
793 | Dst: FromBytes + IntoBytes,
49+
806 | Dst: FromBytes + IntoBytes,
5050
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
5151
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
5252

@@ -73,12 +73,12 @@ help: the trait `IntoBytes` is not implemented for `DstB`
7373
AtomicIsize
7474
and 74 others
7575
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
76-
--> $WORKSPACE/src/util/macro_util.rs:793:26
76+
--> $WORKSPACE/src/util/macro_util.rs:806:26
7777
|
78-
790 | pub fn transmute_mut(self) -> &'a mut Dst
78+
803 | pub fn transmute_mut(self) -> &'a mut Dst
7979
| ------------- required by a bound in this associated function
8080
...
81-
793 | Dst: FromBytes + IntoBytes,
81+
806 | Dst: FromBytes + IntoBytes,
8282
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
8383
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
8484

@@ -149,12 +149,12 @@ help: the trait `FromBytes` is not implemented for `SrcC`
149149
(A, B, C, D, E, F, G, H)
150150
and 85 others
151151
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
152-
--> $WORKSPACE/src/util/macro_util.rs:792:14
152+
--> $WORKSPACE/src/util/macro_util.rs:805:14
153153
|
154-
790 | pub fn transmute_mut(self) -> &'a mut Dst
154+
803 | pub fn transmute_mut(self) -> &'a mut Dst
155155
| ------------- required by a bound in this associated function
156-
791 | where
157-
792 | Src: FromBytes + IntoBytes,
156+
804 | where
157+
805 | Src: FromBytes + IntoBytes,
158158
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
159159
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
160160

@@ -181,12 +181,12 @@ help: the trait `IntoBytes` is not implemented for `SrcD`
181181
AtomicIsize
182182
and 74 others
183183
note: required by a bound in `Wrap::<&'a mut Src, &'a mut Dst>::transmute_mut`
184-
--> $WORKSPACE/src/util/macro_util.rs:792:26
184+
--> $WORKSPACE/src/util/macro_util.rs:805:26
185185
|
186-
790 | pub fn transmute_mut(self) -> &'a mut Dst
186+
803 | pub fn transmute_mut(self) -> &'a mut Dst
187187
| ------------- required by a bound in this associated function
188-
791 | where
189-
792 | Src: FromBytes + IntoBytes,
188+
804 | where
189+
805 | Src: FromBytes + IntoBytes,
190190
| ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::transmute_mut`
191191
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
192192

@@ -196,9 +196,9 @@ error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut
196196
87 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
197197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198198
|
199-
::: $WORKSPACE/src/util/macro_util.rs:679:1
199+
::: $WORKSPACE/src/util/macro_util.rs:692:1
200200
|
201-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
201+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
202202
| ------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst<'_>`
203203
|
204204
= note: the following trait bounds were not satisfied:

tests/ui/transmute_ref.msrv.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ error[E0599]: the method `transmute_ref` exists for struct `Wrap<&[u8], &[u8; 1]
188188
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
189189
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&[u8], &[u8; 1]>` due to unsatisfied trait bounds
190190
|
191-
::: $WORKSPACE/src/util/macro_util.rs:679:1
191+
::: $WORKSPACE/src/util/macro_util.rs:692:1
192192
|
193-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
193+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
194194
| --------------------------------------------------------- doesn't satisfy `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst`
195195
|
196196
= note: the following trait bounds were not satisfied:

tests/ui/transmute_ref.nightly.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ error[E0599]: the method `transmute_ref` exists for struct `zerocopy::util::macr
342342
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
343343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
344344
|
345-
::: src/util/macro_util.rs:679:1
345+
::: src/util/macro_util.rs:692:1
346346
|
347-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
347+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
348348
| ------------------------- doesn't satisfy `_: TransmuteRefDst<'_>`
349349
|
350350
= note: the following trait bounds were not satisfied:

tests/ui/transmute_ref.stable.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ error[E0599]: the method `transmute_ref` exists for struct `Wrap<&[u8], &[u8; 1]
342342
84 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
343343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
344344
|
345-
::: $WORKSPACE/src/util/macro_util.rs:679:1
345+
::: $WORKSPACE/src/util/macro_util.rs:692:1
346346
|
347-
679 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
347+
692 | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
348348
| ------------------------- doesn't satisfy `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst<'_>`
349349
|
350350
= note: the following trait bounds were not satisfied:

tests/ui/try_transmute.msrv.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
55
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy`
66
|
77
note: required by a bound in `try_transmute`
8-
--> $WORKSPACE/src/util/macro_util.rs:513:10
8+
--> $WORKSPACE/src/util/macro_util.rs:526:10
99
|
10-
513 | Dst: TryFromBytes,
10+
526 | Dst: TryFromBytes,
1111
| ^^^^^^^^^^^^ required by this bound in `try_transmute`
1212
= note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
1313

@@ -43,9 +43,9 @@ error[E0277]: the trait bound `NotZerocopy<AU16>: IntoBytes` is not satisfied
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy<AU16>`
4444
|
4545
note: required by a bound in `try_transmute`
46-
--> $WORKSPACE/src/util/macro_util.rs:512:10
46+
--> $WORKSPACE/src/util/macro_util.rs:525:10
4747
|
48-
512 | Src: IntoBytes,
48+
525 | Src: IntoBytes,
4949
| ^^^^^^^^^ required by this bound in `try_transmute`
5050
= note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
5151

tests/ui/try_transmute.nightly.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
4949
(A, B, C, D, E, F, G, H)
5050
and 153 others
5151
note: required by a bound in `zerocopy::util::macro_util::try_transmute`
52-
--> src/util/macro_util.rs:513:10
52+
--> src/util/macro_util.rs:526:10
5353
|
54-
510 | pub fn try_transmute<Src, Dst>(src: Src) -> Result<Dst, ValidityError<Src, Dst>>
54+
523 | pub fn try_transmute<Src, Dst>(src: Src) -> Result<Dst, ValidityError<Src, Dst>>
5555
| ------------- required by a bound in this function
5656
...
57-
513 | Dst: TryFromBytes,
57+
526 | Dst: TryFromBytes,
5858
| ^^^^^^^^^^^^ required by this bound in `try_transmute`
5959
= note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
6060

@@ -110,12 +110,12 @@ help: the trait `IntoBytes` is not implemented for `NotZerocopy<AU16>`
110110
AtomicIsize
111111
and 68 others
112112
note: required by a bound in `zerocopy::util::macro_util::try_transmute`
113-
--> src/util/macro_util.rs:512:10
113+
--> src/util/macro_util.rs:525:10
114114
|
115-
510 | pub fn try_transmute<Src, Dst>(src: Src) -> Result<Dst, ValidityError<Src, Dst>>
115+
523 | pub fn try_transmute<Src, Dst>(src: Src) -> Result<Dst, ValidityError<Src, Dst>>
116116
| ------------- required by a bound in this function
117-
511 | where
118-
512 | Src: IntoBytes,
117+
524 | where
118+
525 | Src: IntoBytes,
119119
| ^^^^^^^^^ required by this bound in `try_transmute`
120120
= note: this error originates in the macro `try_transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
121121

0 commit comments

Comments
 (0)