File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1111//! This module attempts to reconstruct the original where and/or parameter
1212//! bounds by special casing scenarios such as these. Fun!
1313
14- use std:: collections:: BTreeMap ;
15-
14+ use rustc_data_structures:: fx:: FxIndexMap ;
1615use rustc_hir:: def_id:: DefId ;
1716use rustc_middle:: ty;
1817use rustc_span:: Symbol ;
@@ -23,8 +22,11 @@ use crate::clean::WherePredicate as WP;
2322use crate :: core:: DocContext ;
2423
2524crate fn where_clauses ( cx : & DocContext < ' _ > , clauses : Vec < WP > ) -> Vec < WP > {
26- // First, partition the where clause into its separate components
27- let mut params: BTreeMap < _ , ( Vec < _ > , Vec < _ > ) > = BTreeMap :: new ( ) ;
25+ // First, partition the where clause into its separate components.
26+ //
27+ // We use `FxIndexMap` so that the insertion order is preserved to prevent messing up to
28+ // the order of the generated bounds.
29+ let mut params: FxIndexMap < Symbol , ( Vec < _ > , Vec < _ > ) > = FxIndexMap :: default ( ) ;
2830 let mut lifetimes = Vec :: new ( ) ;
2931 let mut equalities = Vec :: new ( ) ;
3032 let mut tybounds = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments