rust/library/alloc
Matthias Krüger 20f6aa1365
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`.
2023-05-16 20:12:17 +02:00
..
benches remove some unneeded imports 2023-04-12 19:27:18 +02:00
src Rollup merge of #111592 - Nemo157:fix-vec-capacity-examples, r=joshtriplett 2023-05-16 20:12:17 +02:00
tests Rollup merge of #110419 - jsoref:spelling-library, r=jyn514 2023-04-26 18:51:41 +02:00
Cargo.toml Revert "Report allocation errors as panics" 2023-04-25 00:08:37 +02:00