1error: this conflicts with another representation hint 2 --> tests/ui-nightly/struct.rs:133:8 3 | 4133 | #[repr(C, C)] // zerocopy-derive conservatively treats these as conflicting reprs 5 | ^^^^ 6 7error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout 8 --> tests/ui-nightly/struct.rs:138:10 9 | 10138 | #[derive(IntoBytes)] 11 | ^^^^^^^^^ 12 | 13 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 14 15error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout 16 --> tests/ui-nightly/struct.rs:143:10 17 | 18143 | #[derive(IntoBytes)] 19 | ^^^^^^^^^ 20 | 21 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 22 23error: must have a non-align #[repr(...)] attribute in order to guarantee this type's memory layout 24 --> tests/ui-nightly/struct.rs:166:10 25 | 26166 | #[derive(IntoBytes)] 27 | ^^^^^^^^^ 28 | 29 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 30 31error: cannot derive `Unaligned` on type with alignment greater than 1 32 --> tests/ui-nightly/struct.rs:177:11 33 | 34177 | #[repr(C, align(2))] 35 | ^^^^^^^^ 36 37error: this conflicts with another representation hint 38 --> tests/ui-nightly/struct.rs:181:8 39 | 40181 | #[repr(transparent, align(2))] 41 | ^^^^^^^^^^^ 42 43error: this conflicts with another representation hint 44 --> tests/ui-nightly/struct.rs:187:8 45 | 46187 | #[repr(packed, align(2))] 47 | ^^^^^^^^^^^^^^^^ 48 49error: this conflicts with another representation hint 50 --> tests/ui-nightly/struct.rs:191:8 51 | 52191 | #[repr(align(1), align(2))] 53 | ^^^^^^^^^^^^^^^^^^ 54 55error: this conflicts with another representation hint 56 --> tests/ui-nightly/struct.rs:195:8 57 | 58195 | #[repr(align(2), align(4))] 59 | ^^^^^^^^^^^^^^^^^^ 60 61error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment 62 --> tests/ui-nightly/struct.rs:198:10 63 | 64198 | #[derive(Unaligned)] 65 | ^^^^^^^^^ 66 | 67 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) 68 69error: must have #[repr(C)], #[repr(transparent)], or #[repr(packed)] attribute in order to guarantee this type's alignment 70 --> tests/ui-nightly/struct.rs:201:10 71 | 72201 | #[derive(Unaligned)] 73 | ^^^^^^^^^ 74 | 75 = note: this error originates in the derive macro `Unaligned` (in Nightly builds, run with -Z macro-backtrace for more info) 76 77error: this conflicts with another representation hint 78 --> tests/ui-nightly/struct.rs:209:19 79 | 80209 | #[repr(packed(2), C)] 81 | ___________________^ 82210 | | #[derive(Unaligned)] 83211 | | #[repr(C, packed(2))] 84 | |________^ 85 86error[E0692]: transparent struct cannot have other repr hints 87 --> tests/ui-nightly/struct.rs:181:8 88 | 89181 | #[repr(transparent, align(2))] 90 | ^^^^^^^^^^^ ^^^^^^^^ 91 92error[E0277]: the size for values of type `[u8]` cannot be known at compilation time 93 --> tests/ui-nightly/struct.rs:31:10 94 | 9531 | #[derive(KnownLayout)] 96 | ^^^^^^^^^^^ doesn't have a size known at compile-time 97 | 98 = help: within `KL00`, the trait `Sized` is not implemented for `[u8]` 99note: required because it appears within the type `KL00` 100 --> tests/ui-nightly/struct.rs:32:8 101 | 10232 | struct KL00(u8, NotKnownLayoutDst); 103 | ^^^^ 104 = help: see issue #48214 105 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) 106help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 107 | 1089 + #![feature(trivial_bounds)] 109 | 110 111error[E0277]: the size for values of type `[u8]` cannot be known at compilation time 112 --> tests/ui-nightly/struct.rs:36:10 113 | 11436 | #[derive(KnownLayout)] 115 | ^^^^^^^^^^^ doesn't have a size known at compile-time 116 | 117 = help: within `KL02`, the trait `Sized` is not implemented for `[u8]` 118note: required because it appears within the type `KL02` 119 --> tests/ui-nightly/struct.rs:37:8 120 | 12137 | struct KL02(u8, [u8]); 122 | ^^^^ 123 = help: see issue #48214 124 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) 125help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 126 | 1279 + #![feature(trivial_bounds)] 128 | 129 130error[E0277]: the trait bound `NotKnownLayoutDst: zerocopy::KnownLayout` is not satisfied 131 --> tests/ui-nightly/struct.rs:41:10 132 | 13341 | #[derive(KnownLayout)] 134 | ^^^^^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayoutDst` 135 | 136 = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayoutDst` 137 = help: the following other types implement trait `zerocopy::KnownLayout`: 138 &T 139 &mut T 140 () 141 *const T 142 *mut T 143 AU16 144 AtomicBool 145 AtomicI16 146 and $N others 147 = help: see issue #48214 148 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) 149help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 150 | 1519 + #![feature(trivial_bounds)] 152 | 153 154error[E0277]: the trait bound `NotKnownLayout: zerocopy::KnownLayout` is not satisfied 155 --> tests/ui-nightly/struct.rs:47:10 156 | 15747 | #[derive(KnownLayout)] 158 | ^^^^^^^^^^^ the trait `zerocopy::KnownLayout` is not implemented for `NotKnownLayout` 159 | 160 = note: Consider adding `#[derive(KnownLayout)]` to `NotKnownLayout` 161 = help: the following other types implement trait `zerocopy::KnownLayout`: 162 &T 163 &mut T 164 () 165 *const T 166 *mut T 167 AU16 168 AtomicBool 169 AtomicI16 170 and $N others 171 = help: see issue #48214 172 = note: this error originates in the derive macro `KnownLayout` (in Nightly builds, run with -Z macro-backtrace for more info) 173help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 174 | 1759 + #![feature(trivial_bounds)] 176 | 177 178error[E0277]: the trait bound `UnsafeCell<()>: zerocopy::Immutable` is not satisfied 179 --> tests/ui-nightly/struct.rs:55:10 180 | 18155 | #[derive(Immutable)] 182 | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<()>` 183 | 184 = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<()>` 185 = help: the following other types implement trait `zerocopy::Immutable`: 186 &T 187 &mut T 188 () 189 *const T 190 *mut T 191 AU16 192 F32<O> 193 F64<O> 194 and $N others 195 = help: see issue #48214 196 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) 197help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 198 | 1999 + #![feature(trivial_bounds)] 200 | 201 202error[E0277]: the trait bound `UnsafeCell<u8>: zerocopy::Immutable` is not satisfied 203 --> tests/ui-nightly/struct.rs:60:10 204 | 20560 | #[derive(Immutable)] 206 | ^^^^^^^^^ the trait `zerocopy::Immutable` is not implemented for `UnsafeCell<u8>` 207 | 208 = note: Consider adding `#[derive(Immutable)]` to `UnsafeCell<u8>` 209 = help: the following other types implement trait `zerocopy::Immutable`: 210 &T 211 &mut T 212 () 213 *const T 214 *mut T 215 AU16 216 F32<O> 217 F64<O> 218 and $N others 219 = note: required for `[UnsafeCell<u8>; 0]` to implement `zerocopy::Immutable` 220 = help: see issue #48214 221 = note: this error originates in the derive macro `Immutable` (in Nightly builds, run with -Z macro-backtrace for more info) 222help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 223 | 2249 + #![feature(trivial_bounds)] 225 | 226 227error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type 228 --> tests/ui-nightly/struct.rs:71:1 229 | 23071 | struct TryFromBytesPacked { 231 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 232 | 233note: `AU16` has a `#[repr(align)]` attribute 234 --> tests/ui-nightly/../include.rs 235 | 236 | pub struct AU16(pub u16); 237 | ^^^^^^^^^^^^^^^ 238 239error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type 240 --> tests/ui-nightly/struct.rs:77:1 241 | 24277 | struct TryFromBytesPackedN { 243 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 244 | 245note: `AU16` has a `#[repr(align)]` attribute 246 --> tests/ui-nightly/../include.rs 247 | 248 | pub struct AU16(pub u16); 249 | ^^^^^^^^^^^^^^^ 250 251error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type 252 --> tests/ui-nightly/struct.rs:83:1 253 | 25483 | struct TryFromBytesCPacked { 255 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 256 | 257note: `AU16` has a `#[repr(align)]` attribute 258 --> tests/ui-nightly/../include.rs 259 | 260 | pub struct AU16(pub u16); 261 | ^^^^^^^^^^^^^^^ 262 263error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type 264 --> tests/ui-nightly/struct.rs:89:1 265 | 26689 | struct TryFromBytesCPackedN { 267 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 268 | 269note: `AU16` has a `#[repr(align)]` attribute 270 --> tests/ui-nightly/../include.rs 271 | 272 | pub struct AU16(pub u16); 273 | ^^^^^^^^^^^^^^^ 274 275error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied 276 --> tests/ui-nightly/struct.rs:100:10 277 | 278100 | #[derive(IntoBytes)] 279 | ^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` 280 | 281 = note: Consider adding `#[derive(Unaligned)]` to `AU16` 282 = help: the following other types implement trait `zerocopy::Unaligned`: 283 () 284 AtomicBool 285 AtomicI8 286 AtomicU8 287 F32<O> 288 F64<O> 289 I128<O> 290 I16<O> 291 and $N others 292 = help: see issue #48214 293 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 294help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 295 | 2969 + #![feature(trivial_bounds)] 297 | 298 299error[E0277]: `IntoBytes2` has inter-field padding 300 --> tests/ui-nightly/struct.rs:107:10 301 | 302107 | #[derive(IntoBytes)] 303 | ^^^^^^^^^ types with padding cannot implement `IntoBytes` 304 | 305 = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields 306 = note: consider adding explicit fields where padding would be 307 = note: consider using `#[repr(packed)]` to remove inter-field padding 308 = help: the trait `PaddingFree<IntoBytes2, true>` is not implemented for `()` 309 but trait `PaddingFree<IntoBytes2, false>` is implemented for it 310 = help: see issue #48214 311 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 312help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 313 | 3149 + #![feature(trivial_bounds)] 315 | 316 317error[E0277]: `IntoBytes3` has inter-field padding 318 --> tests/ui-nightly/struct.rs:114:10 319 | 320114 | #[derive(IntoBytes)] 321 | ^^^^^^^^^ types with padding cannot implement `IntoBytes` 322 | 323 = note: consider using `zerocopy::Unalign` to lower the alignment of individual fields 324 = note: consider adding explicit fields where padding would be 325 = note: consider using `#[repr(packed)]` to remove inter-field padding 326 = help: the trait `PaddingFree<IntoBytes3, true>` is not implemented for `()` 327 but trait `PaddingFree<IntoBytes3, false>` is implemented for it 328 = help: see issue #48214 329 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 330help: add `#![feature(trivial_bounds)]` to the crate attributes to enable 331 | 3329 + #![feature(trivial_bounds)] 333 | 334 335error[E0277]: the size for values of type `[u8]` cannot be known at compilation time 336 --> tests/ui-nightly/struct.rs:125:10 337 | 338125 | #[derive(IntoBytes)] 339 | ^^^^^^^^^ doesn't have a size known at compile-time 340 | 341 = help: within `IntoBytes4`, the trait `Sized` is not implemented for `[u8]` 342note: required because it appears within the type `IntoBytes4` 343 --> tests/ui-nightly/struct.rs:127:8 344 | 345127 | struct IntoBytes4 { 346 | ^^^^^^^^^^ 347 = note: required for `IntoBytes4` to implement `macro_util::__size_of::Sized` 348note: required by a bound in `macro_util::__size_of::size_of` 349 --> $WORKSPACE/src/util/macro_util.rs 350 | 351 | pub const fn size_of<T: Sized + ?core::marker::Sized>() -> usize { 352 | ^^^^^ required by this bound in `size_of` 353 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 354 355error[E0277]: `[u8]` is unsized 356 --> tests/ui-nightly/struct.rs:129:8 357 | 358129 | b: [u8], 359 | ^^^^ `IntoBytes` needs all field types to be `Sized` in order to determine whether there is inter-field padding 360 | 361 = help: the trait `Sized` is not implemented for `[u8]` 362 = note: consider using `#[repr(packed)]` to remove inter-field padding 363 = note: `IntoBytes` does not require the fields of `#[repr(packed)]` types to be `Sized` 364 = note: required for `[u8]` to implement `macro_util::__size_of::Sized` 365note: required by a bound in `macro_util::__size_of::size_of` 366 --> $WORKSPACE/src/util/macro_util.rs 367 | 368 | pub const fn size_of<T: Sized + ?core::marker::Sized>() -> usize { 369 | ^^^^^ required by this bound in `size_of` 370 371error[E0587]: type has conflicting packed and align representation hints 372 --> tests/ui-nightly/struct.rs:188:1 373 | 374188 | struct Unaligned3; 375 | ^^^^^^^^^^^^^^^^^ 376 377error[E0277]: the trait bound `AU16: zerocopy::Unaligned` is not satisfied 378 --> tests/ui-nightly/struct.rs:161:28 379 | 380161 | is_into_bytes_11::<IntoBytes11<AU16>>(); 381 | ^^^^^^^^^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `AU16` 382 | 383 = note: Consider adding `#[derive(Unaligned)]` to `AU16` 384 = help: the following other types implement trait `zerocopy::Unaligned`: 385 () 386 AtomicBool 387 AtomicI8 388 AtomicU8 389 F32<O> 390 F64<O> 391 I128<O> 392 I16<O> 393 and $N others 394note: required for `IntoBytes11<AU16>` to implement `zerocopy::IntoBytes` 395 --> tests/ui-nightly/struct.rs:150:10 396 | 397150 | #[derive(IntoBytes)] 398 | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro 399note: required by a bound in `is_into_bytes_11` 400 --> tests/ui-nightly/struct.rs:159:24 401 | 402159 | fn is_into_bytes_11<T: IntoBytes>() { 403 | ^^^^^^^^^ required by this bound in `is_into_bytes_11` 404 = note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info) 405