rust/compiler/rustc_ast_lowering/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
..
asm.rs Changes made in response to feedback 2022-08-22 19:24:14 +02:00
block.rs Completely remove captures flag 2022-08-04 11:26:53 -03:00
errors.rs remove span_fatal from ast_lowering 2022-08-27 09:15:55 +02:00
expr.rs Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino 2022-09-01 08:01:06 +00:00
index.rs Make Node::ExprField a child of Node::Expr. 2022-08-11 21:48:39 -07:00
item.rs Migrate all span_err(...) in ast_lowering to SessionDiagnostic 2022-08-22 19:21:41 +02:00
lib.rs Auto merge of #100707 - dzvon:fix-typo, r=davidtwco 2022-09-01 05:39:58 +00:00
lifetime_collector.rs Simplify rustc_ast::visit::Visitor::visit_poly_trait_ref. 2022-08-11 11:10:01 +10:00
pat.rs Migrate all span_err(...) in ast_lowering to SessionDiagnostic 2022-08-22 19:21:41 +02:00
path.rs Migrate ast_lowering::path to SessionDiagnostic 2022-08-22 19:19:58 +02:00