From 231dbbcb6ac0bc32e77dd7f3bf0443f493161c65 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 31 Dec 2023 13:04:43 +0100 Subject: rustc_lint: Make `LintLevelsProvider::current_specs()` return `&FxIndexMap` So that lint iteration order becomes predicitable. Discovered with `rustc::potential_query_instability`. --- compiler/rustc_errors/src/diagnostic.rs | 4 ++-- compiler/rustc_errors/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index c226b2d41bd..49431fb7b3f 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -3,7 +3,7 @@ use crate::{ CodeSuggestion, DiagnosticBuilder, DiagnosticMessage, EmissionGuarantee, Level, MultiSpan, SubdiagnosticMessage, Substitution, SubstitutionPart, SuggestionStyle, }; -use rustc_data_structures::fx::FxHashMap; +use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; use rustc_error_messages::fluent_value_from_str_list_sep_by_and; use rustc_error_messages::FluentValue; use rustc_lint_defs::{Applicability, LintExpectationId}; @@ -259,7 +259,7 @@ impl Diagnostic { pub(crate) fn update_unstable_expectation_id( &mut self, - unstable_to_stable: &FxHashMap, + unstable_to_stable: &FxIndexMap, ) { if let Level::Expect(expectation_id) | Level::Warning(Some(expectation_id)) = &mut self.level diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index e436591fdd9..e9507dcfed7 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -55,7 +55,7 @@ pub use termcolor::{Color, ColorSpec, WriteColor}; use crate::diagnostic_impls::{DelayedAtWithNewline, DelayedAtWithoutNewline}; use emitter::{is_case_difference, DynEmitter, Emitter, EmitterWriter}; use registry::Registry; -use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; +use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::stable_hasher::{Hash128, StableHasher}; use rustc_data_structures::sync::{Lock, Lrc}; use rustc_data_structures::AtomicRef; @@ -1318,7 +1318,7 @@ impl DiagCtxt { pub fn update_unstable_expectation_id( &self, - unstable_to_stable: &FxHashMap, + unstable_to_stable: &FxIndexMap, ) { let mut inner = self.inner.borrow_mut(); let diags = std::mem::take(&mut inner.unstable_expect_diagnostics); -- cgit 1.4.1-3-g733a5