File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11
11
//! This module attempts to reconstruct the original where and/or parameter
12
12
//! bounds by special casing scenarios such as these. Fun!
13
13
14
- use std:: collections:: BTreeMap ;
15
-
14
+ use rustc_data_structures:: fx:: FxIndexMap ;
16
15
use rustc_hir:: def_id:: DefId ;
17
16
use rustc_middle:: ty;
18
17
use rustc_span:: Symbol ;
@@ -23,8 +22,11 @@ use crate::clean::WherePredicate as WP;
23
22
use crate :: core:: DocContext ;
24
23
25
24
crate 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 ( ) ;
28
30
let mut lifetimes = Vec :: new ( ) ;
29
31
let mut equalities = Vec :: new ( ) ;
30
32
let mut tybounds = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments