Closed zmerp closed 2 months ago
Does the spec guarantee defined behavior when passing an extension struct from a disabled extension at all? I think it would be safer to check if the extension is enabled and bail out without making any XR calls at all if not.
Ok. Should I revert back to using T::out()?
That would be more consistent, yeah.
It looks like the answer to my question above is actually "yes":
A runtime must ignore all unrecognized structures in a next chain, including those associated with an extension that has not been enabled.
So either approach seems fine. That said, the current form is concise and might make user error a bit more obvious, so I'm happy with it.
I'm sorry I made a mistake. I opened another PR to check the correct extension
Closes #169
This solution works but it would be even more concise if the structsAs per review, I switched to checking if the extension is present instead.sys::System<Prop>
would implementDefault
. TheDefault
impl should already set the correctty
, and maybe theout()
methods should base off the default value and returnT
instead ofMaybeUninit<T>
.