Skip to content

Commit 9028b53

Browse files
committed
rustdoc-json: Use FxHashMap from rustdoc_json_types
1 parent 026e9ed commit 9028b53

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: src/librustdoc/json/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ use std::io::{stdout, BufWriter, Write};
1313
use std::path::PathBuf;
1414
use std::rc::Rc;
1515

16-
use rustc_data_structures::fx::FxHashMap;
1716
use rustc_hir::def_id::{DefId, DefIdSet};
1817
use rustc_middle::ty::TyCtxt;
1918
use rustc_session::Session;
2019
use rustc_span::def_id::LOCAL_CRATE;
2120
use rustdoc_json_types as types;
21+
// It's important to use the FxHashMap from rustdoc_json_types here, instead of
22+
// the one from rustc_data_structures, as they're different types due to sysroots.
23+
// See #110051 and #127456 for details
24+
use rustdoc_json_types::FxHashMap;
2225

2326
use crate::clean::types::{ExternalCrate, ExternalLocation};
2427
use crate::clean::ItemKind;
@@ -234,14 +237,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
234237
let index = (*self.index).clone().into_inner();
235238

236239
debug!("Constructing Output");
237-
// This needs to be the default HashMap for compatibility with the public interface for
238-
// rustdoc-json-types
239-
#[allow(rustc::default_hash_types)]
240240
let output = types::Crate {
241241
root: types::Id(format!("0:0:{}", e.name(self.tcx).as_u32())),
242242
crate_version: self.cache.crate_version.clone(),
243243
includes_private: self.cache.document_private,
244-
index: index.into_iter().collect(),
244+
index,
245245
paths: self
246246
.cache
247247
.paths

Diff for: src/rustdoc-json-types/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
use std::path::PathBuf;
77

8-
use rustc_hash::FxHashMap;
8+
pub use rustc_hash::FxHashMap;
99
use serde::{Deserialize, Serialize};
1010

1111
/// The version of JSON output that this crate represents.

0 commit comments

Comments
 (0)