-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider supporting owned Unstructured
s
#147
Comments
The |
Out of curiosity, I made a little POC in the cranelift control plane with The code complexity did increase in my opinion. Solving this problem within |
Talking with some folks who would like to pass around an
Unstructured
through Cranelift to implement a "chaos mode" that does semantics-preserving random mutations like shuffle basic blocks, but don't want to threadUnstructured
's lifetimes through the whole code base. Would instead like to have an owned version ofUnstructured
that they can attach to existing context structures.Could do this with a wrapper struct and self borrows but would like to make sure this is UB-free and in a place where it can be reused by anyone else who has similar needs:
Another approach could be to have a
Cow<'a, [u8]>
inUnstructured
itself, although then you'd end up with anUnstructured<'static>
but the way thatArbitrary
is defined, this would let you create arbitrary&'static [u8]
s which is not correct.Not even sure if this is the right approach, might be better to do something like
Just brainstorming at this point.
Thoughts? Ideas?
cc @cfallin
The text was updated successfully, but these errors were encountered: