-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Labels
blocking-next-releaseThis issue should be resolved before we release on crates.ioThis issue should be resolved before we release on crates.io
Description
Progress
- Restrict
KnownLayout for Unalign<T>to requireT: KnownLayout(add a test to confirm this behavior doesn't regress)- Record the fact that the reason for doing it this way (rather than always implementing it manually - even when
feature = "derive"- without aT: KnownLayoutbound) is to be forwards-compatible with supporting unsizedUnalign(#209)
- Record the fact that the reason for doing it this way (rather than always implementing it manually - even when
- Teach
impl_or_verify!to supportKnownLayout- theUnalignbounds issue wasn't caught because, forKnownLayout, we useimpl_known_layout!rather thanimpl_or_verify! - [Possibly after 0.8] Relax so that
T: KnownLayoutnever requires its fields to beKnownLayout
Details
Relates to #29.
Consider the following code:
#[derive(KnownLayout]
#[repr(C)]
pub struct Foo<T>(T);Since T has an implicit T: Sized bound, our emitted derive should not require that T: KnownLayout, but it does. This is currently affecting Unalign, resulting in it having a different bound when compiling with feature = "derive" (namely, T: KnownLayout) than when compiling without feature = "derive".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
blocking-next-releaseThis issue should be resolved before we release on crates.ioThis issue should be resolved before we release on crates.io