diff options
author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-05-16 20:12:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 20:12:17 +0200 |
commit | 20f6aa1365d556edf4804fc502f1f29c1ef9fdcb (patch) | |
tree | 0da71f65d7835b13e6e16b60b49e62f9d684045d /tests/rustdoc-js-std/parser-errors.js | |
parent | 6dc365003bce4cdc11e73fcfe4c61c6da56acd65 (diff) | |
parent | a9cb4822be753ef995a481cf77a4c3cbd41c9464 (diff) | |
download | rust-20f6aa1365d556edf4804fc502f1f29c1ef9fdcb.tar.gz |
Rollup merge of #111592 - Nemo157:fix-vec-capacity-examples, r=joshtriplett
Change Vec examples to not assert exact capacity except where it is guaranteed
It was [brought up on discord](https://discord.com/channels/273534239310479360/818964227783262209/1107633959329878077) that the `Vec::into_boxed_slice` example contradicted the `Vec::with_capacity` docs in that the returned `Vec` might have _more_ capacity than requested.
So, to reduce confusion change all the `assert_eq!(vec.capacity(), _)` to `assert!(vec.capacity() >= _)`, except in 4 examples that have guaranteed capacities: `Vec::from_raw_parts`, `Vec::from_raw_parts_in`, `Vec::<()>::with_capacity`,`Vec::<(), _>::with_capacity_in`.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions