-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Labels
blocked-on-rustBlocked on a Rust feature landing or stabilizingBlocked on a Rust feature landing or stabilizingbugSomething isn't workingSomething isn't working
Description
In some cases, #[derive(KnownLayout)]
generates code like this:
trait KnownLayout {
type PointerMetadata;
}
mod foo {
use super::*;
pub struct Foo {
bar: Bar,
}
impl KnownLayout for Foo {
type PointerMetadata = <Bar as KnownLayout>::PointerMetadata;
}
struct Bar;
impl KnownLayout for Bar {
type PointerMetadata = ();
}
}
This causes a private-in-public error:
error[E0446]: private type `Bar` in public interface
--> src/lib.rs:13:9
|
13 | type PointerMetadata = <Bar as KnownLayout>::PointerMetadata;
| ^^^^^^^^^^^^^^^^^^^^ can't leak private type
...
16 | struct Bar;
| ---------- `Bar` declared as private
This is probably a rustc bug.
Metadata
Metadata
Assignees
Labels
blocked-on-rustBlocked on a Rust feature landing or stabilizingBlocked on a Rust feature landing or stabilizingbugSomething isn't workingSomething isn't working