Skip to content

mem::offset_of fails with the type ... has an unknown layout since 1.93.0 / nightly-2025-11-19 #153062

@Firestar99

Description

@Firestar99

searched nightlies: from nightly-2025-10-24 to nightly-2025-12-05
regressed nightly: nightly-2025-11-19
searched commit range: 0df64c5...3d461af
regressed commit: f9e7961

bisected with cargo-bisect-rustc v0.6.11

Host triple: aarch64-unknown-linux-gnu (EDIT: also repos on x86-64-unknown-linux-gnu)
Reproduce with:

cargo bisect-rustc --start 1.92.0 --end 1.93.0 -- b -p space-asset-disk 

Code

Version it worked on

cargo +1.92.0 b -p space-asset-disk builds

Version with regression

cargo +1.93.0 b -p space-asset-disk fails with:

error[E0080]: the type `<Vec<(Image<'_, DynImageMetadata>, String)> as Archive>::Archived` has an unknown layout
  --> space-asset-disk/src/image/image_disk.rs:79:24
   |
79 | #[derive(Clone, Debug, Archive, Serialize, Deserialize)]
   |                        ^^^^^^^ evaluation of `<image::image_disk::ImageStorage as rkyv::Archive>::COPY_OPTIMIZATION::{constant#1}` failed here
   |
   = note: this error originates in the macro `::core::mem::offset_of` which comes from the expansion of the derive macro `Archive` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions