From 5f8bc878af44c875fa49f601b455a44dc1dbe756 Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Fri, 7 Apr 2023 15:21:47 +0100 Subject: [PATCH] Remove `FxHashMap` -> `HashMap` logic now that it's unneeded. Adapts to https://github.com/rust-lang/rust/pull/110051 --- COMMIT.txt | 2 +- src/lib.rs | 7 +++++++ update.sh | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/COMMIT.txt b/COMMIT.txt index 484565a..6066aae 100644 --- a/COMMIT.txt +++ b/COMMIT.txt @@ -1 +1 @@ -52c71e6e2802a50d34ac4a3e96fc2636a3023eb2 +12ad0d6686335e0ee830d85030f815905c2dac90 diff --git a/src/lib.rs b/src/lib.rs index 6ec3c3a..f13c654 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,14 @@ //! These types are the public API exposed through the `--output-format json` flag. The [`Crate`] //! struct is the root of the JSON blob and all other items are contained within. +#![cfg_attr(feature = "rustc_hash", feature(rustc_private))] +#[cfg(feature = "rustc_hash")] +extern crate rustc_hash; +#[cfg(feature = "rustc_hash")] +use rustc_hash::FxHashMap as HashMap; +#[cfg(not(feature = "rustc_hash"))] use std::collections::HashMap; + use serde::{Deserialize, Serialize}; use std::path::PathBuf; diff --git a/update.sh b/update.sh index 859b377..dbe6430 100755 --- a/update.sh +++ b/update.sh @@ -4,11 +4,11 @@ pyjq() { python3 -c "import json, sys; print(json.load(sys.stdin)${1})" } -user="rust-lang" +user="aDotInTheVoid" repo="rust" -branch="master" +branch="rdj-hashmap" -curl -# https://raw.githubusercontent.com/${user}/${repo}/${branch}/src/rustdoc-json-types/lib.rs | sed 's/rustc_hash::/std::collections::/g' | sed 's/FxHashMap/HashMap/g' > src/lib.rs +curl -# https://raw.githubusercontent.com/${user}/${repo}/${branch}/src/rustdoc-json-types/lib.rs > src/lib.rs curl -# https://raw.githubusercontent.com/${user}/${repo}/${branch}/src/rustdoc-json-types/tests.rs > src/tests.rs