You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chain::read/write should require T: FromBytes/IntoBytes #1126
The current trait bounds here are too lax, allowing the compiler to accept code such as:
fnctl_test(chain:&mutChain,mem:&MemCtx,) -> Result<(),()>{letmut a = false;if !chain.read(&mut a,&mem){returnErr(());}Ok(())}
I think every use of this API is using well-formed types (so isn't liable to hit UB on an invalid value), but we can rely on the typesystem to keep us right.
The underlying call to MemCtx::read already requires FromBytes, while MemCtx::write requires only Copy. It should probably also require IntoBytes for symmetry.
Activity
iximeow commentedon Apr 29, 2026
(done in #1130)