Skip to content

Commit

Permalink
note that test_stable_pointers does not reflect a stable guarantee
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 13, 2020
1 parent b6c8455 commit 71a5c46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,9 @@ fn test_stable_pointers() {
// Test that, if we reserved enough space, adding and removing elements does not
// invalidate references into the vector (such as `v0`). This test also
// runs in Miri, which would detect such problems.
// Note that this test does *not* constitute a stable guarantee that all these functions do not
// reallocate! Only what is explicitly documented at
// <https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#guarantees> is stably guaranteed.
let mut v = Vec::with_capacity(128);
v.push(13);

Expand Down

0 comments on commit 71a5c46

Please sign in to comment.