From 42ffdd973e451f78376aef437d937394a4dad6d3 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 21 Feb 2022 18:59:24 +0100 Subject: [PATCH] Make unknown feature error deterministic. --- compiler/rustc_passes/src/stability.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index bf108f220e0..37a9f0ecd8c 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -2,7 +2,7 @@ //! propagating default levels lexically from parent to children ast nodes. use rustc_attr::{self as attr, ConstStability, Stability}; -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; +use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_errors::struct_span_err; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; @@ -854,7 +854,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) { } let declared_lib_features = &tcx.features().declared_lib_features; - let mut remaining_lib_features = FxHashMap::default(); + let mut remaining_lib_features = FxIndexMap::default(); for (feature, span) in declared_lib_features { if !tcx.sess.opts.unstable_features.is_nightly_build() { struct_span_err!( @@ -881,7 +881,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) { remaining_lib_features.remove(&sym::libc); remaining_lib_features.remove(&sym::test); - let check_features = |remaining_lib_features: &mut FxHashMap<_, _>, defined_features: &[_]| { + let check_features = |remaining_lib_features: &mut FxIndexMap<_, _>, defined_features: &[_]| { for &(feature, since) in defined_features { if let Some(since) = since { if let Some(span) = remaining_lib_features.get(&feature) {