Skip to content

Commit 71a5c46

Browse files
committed
note that test_stable_pointers does not reflect a stable guarantee
1 parent b6c8455 commit 71a5c46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/alloc/tests/vec.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,9 @@ fn test_stable_pointers() {
15111511
// Test that, if we reserved enough space, adding and removing elements does not
15121512
// invalidate references into the vector (such as `v0`). This test also
15131513
// runs in Miri, which would detect such problems.
1514+
// Note that this test does *not* constitute a stable guarantee that all these functions do not
1515+
// reallocate! Only what is explicitly documented at
1516+
// <https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#guarantees> is stably guaranteed.
15141517
let mut v = Vec::with_capacity(128);
15151518
v.push(13);
15161519

0 commit comments

Comments
 (0)