rust/compiler/rustc_middle/src
bors eac6c33bc6 Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino
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.

r? `@spastorino`
2022-09-01 08:01:06 +00:00
..
dep_graph Simplify the syntax for macros generated by rustc_queries 2022-08-24 00:37:49 -05:00
hir Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors 2022-08-29 16:49:39 +05:30
infer make PlaceholderConst not store the type of the const 2022-08-01 15:42:38 +01:00
middle Rollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=davidtwco 2022-08-31 14:29:51 +02:00
mir Fix a bunch of typo 2022-08-31 18:24:55 +08:00
query Fix a bunch of typo 2022-08-31 18:24:55 +08:00
thir Rename thir::Adt as thir::AdtExpr. 2022-08-24 15:06:50 +10:00
traits Fix a bunch of typo 2022-08-31 18:24:55 +08:00
ty Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino 2022-09-01 08:01:06 +00:00
util span: move MultiSpan 2022-04-05 07:01:00 +01:00
arena.rs arena > Rc for query results 2022-07-12 15:27:24 +02:00
lib.rs Revert let_chains stabilization 2022-08-29 19:34:11 +02:00
lint.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
macros.rs impl TypeVisitable in type traversal macros 2022-07-05 22:25:33 +01:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Add some more THIR size assertions. 2022-08-24 15:06:50 +10:00