-
Notifications
You must be signed in to change notification settings - Fork 385
Miri detect invalid deallocation where things seems fine #2751
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
Comments
This seems to be an issue in the documentation, albeit a tricky one. The |
One way to fix this would be to add an |
converting to a |
I think so. |
closing in favor of rust-lang/rust#106593 |
I tried to do some things with Strings, and got Miri complaining about attempting to deallocate.
This code is from String::from_raw_parts documentation, except for
s.reserve(1)
which should have no safety impact. In general I have no issue if string capacity == string len, but issues when they differ.miri error:
The text was updated successfully, but these errors were encountered: