提交 b6bce56a 编写于 作者: A Ariel Ben-Yehuda

sort the list of inference errors by span

this should produce more error stability
上级 9d6b9d62
......@@ -333,11 +333,20 @@ fn process_errors(&self, errors: &Vec<RegionResolutionError<'tcx>>)
GenericBoundFailure(..) => true,
};
if errors.iter().all(|e| is_bound_failure(e)) {
let mut errors = if errors.iter().all(|e| is_bound_failure(e)) {
errors.clone()
} else {
errors.iter().filter(|&e| !is_bound_failure(e)).cloned().collect()
}
};
// sort the errors by span, for better error message stability.
errors.sort_by_key(|u| match *u {
ConcreteFailure(ref sro, _, _) => sro.span(),
GenericBoundFailure(ref sro, _, _) => sro.span(),
SubSupConflict(ref rvo, _, _, _, _) => rvo.span(),
});
errors
}
/// Adds a note if the types come from similarly named crates
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册