From e8eb691c1fccc84cf8cf2194b20f0cefafa10fa1 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 21 Apr 2021 21:40:29 -0700 Subject: Use arrayvec 0.7, drop smallvec 0.6 With the arrival of min const generics, many alt-vec libraries have updated to use it in some way and arrayvec is no exception. Use the latest with minor refactoring. Also, rustc_workspace_hack is the only user of smallvec 0.6 in the entire tree, so drop it. --- src/librustdoc/Cargo.toml | 2 +- src/librustdoc/clean/types.rs | 8 ++++---- src/tools/rustc-workspace-hack/Cargo.toml | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index d778a507425..b816b9d7188 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" path = "lib.rs" [dependencies] -arrayvec = { version = "0.5.1", default-features = false } +arrayvec = { version = "0.7", default-features = false } pulldown-cmark = { version = "0.8", default-features = false } minifier = "0.0.39" rayon = { version = "0.3.0", package = "rustc-rayon" } diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 2b25c6a26bc..675de640c70 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1616,18 +1616,18 @@ impl PrimitiveType { } } - crate fn impls(&self, tcx: TyCtxt<'_>) -> &'static ArrayVec<[DefId; 4]> { + crate fn impls(&self, tcx: TyCtxt<'_>) -> &'static ArrayVec { Self::all_impls(tcx).get(self).expect("missing impl for primitive type") } - crate fn all_impls(tcx: TyCtxt<'_>) -> &'static FxHashMap> { - static CELL: OnceCell>> = OnceCell::new(); + crate fn all_impls(tcx: TyCtxt<'_>) -> &'static FxHashMap> { + static CELL: OnceCell>> = OnceCell::new(); CELL.get_or_init(move || { use self::PrimitiveType::*; let single = |a: Option| a.into_iter().collect(); - let both = |a: Option, b: Option| -> ArrayVec<_> { + let both = |a: Option, b: Option| -> ArrayVec<_, 4> { a.into_iter().chain(b).collect() }; diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml index 8da7db2dfdd..5776d56d187 100644 --- a/src/tools/rustc-workspace-hack/Cargo.toml +++ b/src/tools/rustc-workspace-hack/Cargo.toml @@ -71,7 +71,6 @@ proc-macro2 = { version = "1", features = ["default"] } quote = { version = "1", features = ["default"] } serde = { version = "1.0.82", features = ['derive'] } serde_json = { version = "1.0.31", features = ["raw_value", "unbounded_depth"] } -smallvec-0_6 = { package = "smallvec", version = "0.6.14", features = ['union', 'may_dangle'] } smallvec = { version = "1.6.1", features = ['union', 'may_dangle'] } syn = { version = "1", features = ['fold', 'full', 'extra-traits', 'visit', 'visit-mut'] } url = { version = "2.0", features = ['serde'] } -- cgit 1.4.1-3-g733a5