-
Notifications
You must be signed in to change notification settings - Fork 13
Add 'with()' and 'with_mut()' as associated functions to ErasedPtr #82
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
base: master
Are you sure you want to change the base?
Conversation
I believe the API is sound, but the implementation isn't. The Apparently, I configured miri to not run for PRs, but if you run Additionally,
|
Note: I should've made this WIP/RFC
OOps I was a bit in a hurry earlier, I'll fix this later.
I agree there, just didn't want to make a too intrusive change. Is there any reason that
Which offers 2 advantages:
Makes sense
I have a somewhat more convoluted problem here where i need to name/declare a recursive type which obliviously wont work.
Make me wonder if it would have some benefit to add some tricks to make sure that Would be even nicer if this can be turned into a compile error, but i think that's not possible :/ |
494e8e3
to
cd77ea9
Compare
Fixed the ManuallyDrop/Guard issues. Still left the functions in the trait, I'd like to what you prefer, either making |
This allows one to use ErasedPtr where rust won't allow a typed reference. For example in recursive types.
* remove references of the unerased value * fix memory leaks in tests by unerase/drop the erased values
- using scopeguard to write the pointer back into its original place - correct the ManuallyDrop() to wrap the actual value and take it out in the scopeguard
This allows one to use ErasedPtr where rust won't allow a typed reference. For example in recursive types.