Skip to content

Commit 5aac7a5

Browse files
committed
add reasons of using BTreeMap to a comment
1 parent 090669d commit 5aac7a5

File tree

1 file changed

+6
-0
lines changed
  • src/librustc/infer/region_inference

1 file changed

+6
-0
lines changed

src/librustc/infer/region_inference/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ pub struct RegionVarBindings<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
187187
/// Constraints of the form `A <= B` introduced by the region
188188
/// checker. Here at least one of `A` and `B` must be a region
189189
/// variable.
190+
///
191+
/// Using `BTreeMap` because the order in which we iterate over
192+
/// these constraints can affect the way we build the region graph,
193+
/// which in turn affects the way that region errors are reported,
194+
/// leading to small variations in error output across runs and
195+
/// platforms.
190196
constraints: RefCell<BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>>,
191197

192198
/// A "verify" is something that we need to verify after inference is

0 commit comments

Comments
 (0)