You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 of x in to_push. We don't want to put x at position i as it would overwrite an already existing value. Instead we want it at position i+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:
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: