Rollup merge of #76677 - RalfJung:stable-pointers, r=jonas-schievink
note that test_stable_pointers does not reflect a stable guarantee Just to be sure...
This commit is contained in:
commit
fe716d0447
@ -1511,6 +1511,9 @@ fn test_stable_pointers() {
|
|||||||
// Test that, if we reserved enough space, adding and removing elements does not
|
// Test that, if we reserved enough space, adding and removing elements does not
|
||||||
// invalidate references into the vector (such as `v0`). This test also
|
// invalidate references into the vector (such as `v0`). This test also
|
||||||
// runs in Miri, which would detect such problems.
|
// 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);
|
let mut v = Vec::with_capacity(128);
|
||||||
v.push(13);
|
v.push(13);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user