Auto merge of #131259 - ismailarilik:handle-potential-query-instability-lint-for-librustdoc, r=notriddle

Handle `librustdoc` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`src/librustdoc/lib.rs`](https://github.com/rust-lang/rust/blob/master/src/librustdoc/lib.rs#L23) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
This commit is contained in:
bors 2024-10-06 14:04:21 +00:00
commit 373971abe4
23 changed files with 114 additions and 115 deletions

View file

@ -6,7 +6,7 @@ use pulldown_cmark::{
};
use rustc_ast as ast;
use rustc_ast::util::comments::beautify_doc_string;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::fx::FxIndexMap;
use rustc_middle::ty::TyCtxt;
use rustc_span::def_id::DefId;
use rustc_span::symbol::{Symbol, kw, sym};
@ -235,8 +235,8 @@ fn span_for_value(attr: &ast::Attribute) -> Span {
/// early and late doc link resolution regardless of their position.
pub fn prepare_to_doc_link_resolution(
doc_fragments: &[DocFragment],
) -> FxHashMap<Option<DefId>, String> {
let mut res = FxHashMap::default();
) -> FxIndexMap<Option<DefId>, String> {
let mut res = FxIndexMap::default();
for fragment in doc_fragments {
let out_str = res.entry(fragment.item_id).or_default();
add_doc_fragment(out_str, fragment);