-
Notifications
You must be signed in to change notification settings - Fork 385
Odd behaviour on self-referential types that use UnsafeCell #1665
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is likely a "raw pointer creation side-effect". If my guess is correct, running Miri with
Unfortunately not, see rust-lang/unsafe-code-guidelines#148. Thanks for the report! However, I will close this as not-a-Miri-bug -- the issue is not in the UB checker, but in the definition of UB itself, so this is better tracked in the UCG repository. |
Thank you for the fast response! It's a shame it doesn't work, but I can work around it. Self referential types are hard :(. |
Yeah, it is annoying indeed. :/ The extreme work-around would be |
Uh oh!
There was an error while loading. Please reload this page.
When running this code under Miri (playground link):
No errors are produced. However, if that line is commented, there is a violation of stacked borrows.
What is the intended behaviour here? And is this a valid way to implement safe self-referential types?
The text was updated successfully, but these errors were encountered: