提交 ec0ad090 编写于 作者: N Niko Matsakis

use a `BTreeSet` for a more stable error message order

上级 3805ebee
......@@ -25,10 +25,11 @@
use rustc::ty::{GenericParamDef, GenericParamDefKind};
use rustc::ty::wf::object_region_bounds;
use rustc_target::spec::abi;
use std::collections::BTreeSet;
use std::slice;
use require_c_abi_if_variadic;
use util::common::ErrorReported;
use util::nodemap::{FxHashSet, FxHashMap};
use util::nodemap::FxHashMap;
use errors::{FatalError, DiagnosticId};
use lint;
......@@ -996,7 +997,9 @@ fn conv_object_ty_poly_trait_ref(&self,
return tcx.types.err;
}
let mut associated_types = FxHashSet::default();
// use a btreeset to keep output in a more consistent order
let mut associated_types = BTreeSet::default();
for tr in traits::supertraits(tcx, principal) {
associated_types.extend(tcx.associated_items(tr.def_id())
.filter(|item| item.kind == ty::AssociatedKind::Type)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册