-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Description
Code
I tried the following in a new cargo project. This is minimized from a real codebase.
[package]
name = "broken-nightly"
version = "0.1.0"
edition = "2024"
[dependencies]
cynic-codegen = { version = "3.12.0", features = [ "rkyv" ] }
[profile.dev.package.cynic-codegen]
opt-level = 1 # only 0 doesn't cause the issueI expected to see this happen: compilation to succeed.
Instead, this happened: multiple errors that are basically impossible to track down the cause of.
error[E0080]: the type `<With<Cow<'_, str>, AsOwned> as Archive>::Archived` has an unknown layout
--> /rustc/254b59607d4417e9dffbc307138ae5c86280fe4c/library/core/src/mem/mod.rs:1251:26
|
= note: evaluation of `<schema::names::ArchivedFieldName<'_> as std::mem::SizedTypeProperties>::ALIGN` failed here
error[E0080]: the type `<std::collections::HashMap<std::string::String, schema::types::Type<'_>> as Archive>::Archived` has an unknown layout
--> /rustc/254b59607d4417e9dffbc307138ae5c86280fe4c/library/core/src/mem/mod.rs:1251:26
|
= note: evaluation of `<schema::type_index::optimised::ArchivedOptimisedTypes<'_> as std::mem::SizedTypeProperties>::ALIGN` failed here
error[E0080]: the type `<schema::types::ObjectType<'_> as Archive>::Archived` has an unknown layout
--> /rustc/254b59607d4417e9dffbc307138ae5c86280fe4c/library/core/src/mem/mod.rs:1251:26
|
= note: evaluation of `<schema::types::ArchivedSchemaRoots<'_> as std::mem::SizedTypeProperties>::ALIGN` failed here
error[E0080]: the type `<schema::types::ScalarType<'_> as Archive>::Archived` has an unknown layout
--> /rustc/254b59607d4417e9dffbc307138ae5c86280fe4c/library/core/src/mem/mod.rs:1251:26
|
= note: evaluation of `<schema::types::ArchivedType<'_> as std::mem::SizedTypeProperties>::ALIGN` failed here
...
For anyone that is encountering this in the wild, updating cynic to be the latest main that uses rkyv 0.8 resolves the issue.
It would seem specifically rkyv 0.7 is causing the issue when applied to the cynic-codegen types.
Version it worked on
It most recently worked on: 1.92.0
Version with regression
rustc --version --verbose:
rustc 1.93.0 (254b59607 2026-01-19)
Running a bisection I get the nightly that introduced the bug to be nightly-2025-10-24. I am unable to get the exact commit at the moment because of GitHub rate limiting.
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged