@@ -13,12 +13,15 @@ use std::io::{stdout, BufWriter, Write};
13
13
use std:: path:: PathBuf ;
14
14
use std:: rc:: Rc ;
15
15
16
- use rustc_data_structures:: fx:: FxHashMap ;
17
16
use rustc_hir:: def_id:: { DefId , DefIdSet } ;
18
17
use rustc_middle:: ty:: TyCtxt ;
19
18
use rustc_session:: Session ;
20
19
use rustc_span:: def_id:: LOCAL_CRATE ;
21
20
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 ;
22
25
23
26
use crate :: clean:: types:: { ExternalCrate , ExternalLocation } ;
24
27
use crate :: clean:: ItemKind ;
@@ -234,14 +237,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
234
237
let index = ( * self . index ) . clone ( ) . into_inner ( ) ;
235
238
236
239
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) ]
240
240
let output = types:: Crate {
241
241
root : types:: Id ( format ! ( "0:0:{}" , e. name( self . tcx) . as_u32( ) ) ) ,
242
242
crate_version : self . cache . crate_version . clone ( ) ,
243
243
includes_private : self . cache . document_private ,
244
- index : index . into_iter ( ) . collect ( ) ,
244
+ index,
245
245
paths : self
246
246
. cache
247
247
. paths
0 commit comments