rust/library/alloc
bors c03c213daf Auto merge of #75677 - cuviper:shrink-towel, r=Mark-Simulacrum
Don't panic in Vec::shrink_to_fit

We can help the compiler see that `Vec::shrink_to_fit` will never reach the panic case in `RawVec::shrink_to_fit`, just by guarding the call only for cases where the capacity is strictly greater. A capacity less than the length is only possible through an unsafe call to `set_len`, which would break the `Vec` invariants, so `shrink_to_fit` can just ignore that.

This removes the panicking code from the examples in both #71861 and #75636.
2020-08-19 02:56:59 +00:00
..
benches More benchmarks of BTreeMap mutation 2020-08-01 20:23:13 +02:00
src Auto merge of #75677 - cuviper:shrink-towel, r=Mark-Simulacrum 2020-08-19 02:56:59 +00:00
tests Move btree unit test to their native, privileged location 2020-08-14 17:54:09 +02:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00