@@ -13,12 +13,15 @@ use std::io::{stdout, BufWriter, Write};
1313use std:: path:: PathBuf ;
1414use std:: rc:: Rc ;
1515
16- use rustc_data_structures:: fx:: FxHashMap ;
1716use rustc_hir:: def_id:: { DefId , DefIdSet } ;
1817use rustc_middle:: ty:: TyCtxt ;
1918use rustc_session:: Session ;
2019use rustc_span:: def_id:: LOCAL_CRATE ;
2120use 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
2326use crate :: clean:: types:: { ExternalCrate , ExternalLocation } ;
2427use 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
0 commit comments