`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.
42 lines
927 B
TOML
42 lines
927 B
TOML
[package]
|
|
name = "rustdoc"
|
|
version = "0.0.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
path = "lib.rs"
|
|
|
|
[dependencies]
|
|
arrayvec = { version = "0.7", default-features = false }
|
|
askama = { version = "0.11", default-features = false, features = ["config"] }
|
|
atty = "0.2"
|
|
itertools = "0.10.1"
|
|
minifier = "0.2.2"
|
|
once_cell = "1.10.0"
|
|
pulldown-cmark = { version = "0.9.2", default-features = false }
|
|
regex = "1"
|
|
rustdoc-json-types = { path = "../rustdoc-json-types" }
|
|
serde_json = "1.0"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
smallvec = "1.8.1"
|
|
tempfile = "3"
|
|
thin-vec = "0.2.8"
|
|
tracing = "0.1"
|
|
tracing-tree = "0.2.0"
|
|
|
|
[dependencies.tracing-subscriber]
|
|
version = "0.3.3"
|
|
default-features = false
|
|
features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"]
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
rayon = "1.5.1"
|
|
|
|
[dev-dependencies]
|
|
expect-test = "1.0"
|
|
|
|
[features]
|
|
jemalloc = []
|
|
|
|
[package.metadata.rust-analyzer]
|
|
rustc_private = true
|