-
Notifications
You must be signed in to change notification settings - Fork 261
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
Potential error in exception-safety #359
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In https://doc.rust-lang.org/nomicon/exception-safety.html I suspect that
self.ptr().add(i).write(x.clone());
is wrong.i
is the position ofx
into_push
. We don't want to putx
at positioni
as it would overwrite an already existing value. Instead we want it at positioni+initial_length
.At least I assume. I don't understand how to find the documentation of
ptr()
, I don't see it in https://doc.rust-lang.org/stable/std/vec/struct.Vec.html . But I can't figure out a semantic off "add" where it makes sens to take "i"The text was updated successfully, but these errors were encountered: