diff options
| author | bors <bors@rust-lang.org> | 2024-02-15 12:36:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-15 12:36:37 +0000 |
| commit | fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f (patch) | |
| tree | 3960d1bfebde79b981e9ac87e62bbc65a1e792d9 /compiler/rustc_errors | |
| parent | 6a4222b5119bce8c24e74dd3ad44006ce0c803e6 (diff) | |
| parent | 3f27e4b3ea35c87c1e8a6b9b8a3c7e122f6299de (diff) | |
| download | rust-fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f.tar.gz rust-fa9f77ff35b4b63ed0cef9a9642c8f881b33f14f.zip | |
Auto merge of #120931 - chenyukang:yukang-cleanup-hashmap, r=michaelwoerister
Clean up potential_query_instability with FxIndexMap and UnordMap From https://github.com/rust-lang/rust/pull/120485#issuecomment-1916437191 r? `@michaelwoerister`
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index b14a12175c7..91a8ec3b794 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, ErrCode, Level, MultiSpan, SubdiagnosticMessage, Substitution, SubstitutionPart, SuggestionStyle, }; -use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; +use rustc_data_structures::fx::FxIndexMap; use rustc_error_messages::fluent_value_from_str_list_sep_by_and; use rustc_error_messages::FluentValue; use rustc_lint_defs::{Applicability, LintExpectationId}; @@ -105,7 +105,7 @@ pub struct Diagnostic { pub span: MultiSpan, pub children: Vec<SubDiagnostic>, pub suggestions: Result<Vec<CodeSuggestion>, SuggestionsDisabled>, - args: FxHashMap<DiagnosticArgName, DiagnosticArgValue>, + args: FxIndexMap<DiagnosticArgName, DiagnosticArgValue>, /// This is not used for highlighting or rendering any error message. Rather, it can be used /// as a sort key to sort a buffer of diagnostics. By default, it is the primary span of @@ -898,9 +898,6 @@ impl Diagnostic { self } - // Exact iteration order of diagnostic arguments shouldn't make a difference to output because - // they're only used in interpolation. - #[allow(rustc::potential_query_instability)] pub fn args(&self) -> impl Iterator<Item = DiagnosticArg<'_>> { self.args.iter() } @@ -914,7 +911,7 @@ impl Diagnostic { self } - pub fn replace_args(&mut self, args: FxHashMap<DiagnosticArgName, DiagnosticArgValue>) { + pub fn replace_args(&mut self, args: FxIndexMap<DiagnosticArgName, DiagnosticArgValue>) { self.args = args; } |
