Skip to content

Commit 42ffdd9

Browse files
committed
Make unknown feature error deterministic.
1 parent 27d8cd7 commit 42ffdd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_passes/src/stability.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! propagating default levels lexically from parent to children ast nodes.
33
44
use rustc_attr::{self as attr, ConstStability, Stability};
5-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5+
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
66
use rustc_errors::struct_span_err;
77
use rustc_hir as hir;
88
use rustc_hir::def::{DefKind, Res};
@@ -854,7 +854,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
854854
}
855855

856856
let declared_lib_features = &tcx.features().declared_lib_features;
857-
let mut remaining_lib_features = FxHashMap::default();
857+
let mut remaining_lib_features = FxIndexMap::default();
858858
for (feature, span) in declared_lib_features {
859859
if !tcx.sess.opts.unstable_features.is_nightly_build() {
860860
struct_span_err!(
@@ -881,7 +881,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
881881
remaining_lib_features.remove(&sym::libc);
882882
remaining_lib_features.remove(&sym::test);
883883

884-
let check_features = |remaining_lib_features: &mut FxHashMap<_, _>, defined_features: &[_]| {
884+
let check_features = |remaining_lib_features: &mut FxIndexMap<_, _>, defined_features: &[_]| {
885885
for &(feature, since) in defined_features {
886886
if let Some(since) = since {
887887
if let Some(span) = remaining_lib_features.get(&feature) {

0 commit comments

Comments
 (0)