rust/compiler/rustc_serialize/src
Nicholas Nethercote b38106b6d8 Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec.
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
  avoid some unnecessary allocations.
2022-08-29 15:42:13 +10:00
..
collection_impls.rs Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec. 2022-08-29 15:42:13 +10:00
leb128.rs Unpeel the first iteration of the loop in impl_read_unsigned_leb128. 2022-01-07 13:36:26 +11:00
lib.rs Adding support for rustc_serialize encode and decode for Box and Vec that use a custom allocator 2022-08-25 20:19:49 +00:00
opaque.rs use BufReader for counting zero bytes 2022-07-02 22:51:42 +09:00
serialize.rs Adding support for rustc_serialize encode and decode for Box and Vec that use a custom allocator 2022-08-25 20:19:49 +00:00