1
Fork 0

rustc_lint: Make LintLevelsProvider::current_specs() return &FxIndexMap

So that lint iteration order becomes predicitable. Discovered with
`rustc::potential_query_instability`.
This commit is contained in:
Martin Nordholts 2023-12-31 13:04:43 +01:00
parent fcfe05aa75
commit 231dbbcb6a
4 changed files with 23 additions and 23 deletions

View file

@ -1,6 +1,6 @@
use std::cmp;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_errors::{Diagnostic, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, MultiSpan};
use rustc_hir::{HirId, ItemLocalId};
@ -61,7 +61,7 @@ pub type LevelAndSource = (Level, LintLevelSource);
/// by the attributes for *a single HirId*.
#[derive(Default, Debug, HashStable)]
pub struct ShallowLintLevelMap {
pub specs: SortedMap<ItemLocalId, FxHashMap<LintId, LevelAndSource>>,
pub specs: SortedMap<ItemLocalId, FxIndexMap<LintId, LevelAndSource>>,
}
/// From an initial level and source, verify the effect of special annotations: