Open
Description
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"
Metadata
Metadata
Assignees
Labels
No labels