Skip to content

Commit a5557c5

Browse files
committed
Rollup merge of rust-lang#33373 - birkenfeld:issue-32555, r=bluss
rustdoc: use btree map for where clauses to get more reproducible output. Fixes: rust-lang#32555 I've looked at the other uses of HashMap in rustdoc, and they seem ok to (i.e. they use `iter()` and related only for constructing a new map, or when the output goes into independent files). Not sure what the cause of rust-lang#24473 is, it shouldn't be where clauses, but maybe it was also fixed inbetween since May 2015.
2 parents eafec60 + 421e6fc commit a5557c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/clean/simplify.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! bounds by special casing scenarios such as these. Fun!
2828
2929
use std::mem;
30-
use std::collections::HashMap;
30+
use std::collections::BTreeMap;
3131

3232
use rustc::hir::def_id::DefId;
3333
use rustc::ty::subst;
@@ -39,7 +39,7 @@ use core::DocContext;
3939

4040
pub fn where_clauses(cx: &DocContext, clauses: Vec<WP>) -> Vec<WP> {
4141
// First, partition the where clause into its separate components
42-
let mut params = HashMap::new();
42+
let mut params = BTreeMap::new();
4343
let mut lifetimes = Vec::new();
4444
let mut equalities = Vec::new();
4545
let mut tybounds = Vec::new();
@@ -62,7 +62,7 @@ pub fn where_clauses(cx: &DocContext, clauses: Vec<WP>) -> Vec<WP> {
6262
// Simplify the type parameter bounds on all the generics
6363
let mut params = params.into_iter().map(|(k, v)| {
6464
(k, ty_bounds(v))
65-
}).collect::<HashMap<_, _>>();
65+
}).collect::<BTreeMap<_, _>>();
6666

6767
// Look for equality predicates on associated types that can be merged into
6868
// general bound predicates

0 commit comments

Comments
 (0)