Sort FxHashSet
's contents before emitting errors for consistent output
This commit is contained in:
parent
38979a3ba1
commit
5402e4833f
2 changed files with 24 additions and 21 deletions
|
@ -452,7 +452,10 @@ pub fn configure_and_expand(
|
|||
|
||||
// Gate identifiers containing invalid Unicode codepoints that were recovered during lexing.
|
||||
sess.parse_sess.bad_unicode_identifiers.with_lock(|identifiers| {
|
||||
for (ident, spans) in identifiers.drain() {
|
||||
let mut identifiers: Vec<_> = identifiers.drain().collect();
|
||||
identifiers.sort_by_key(|&(key, _)| key);
|
||||
for (ident, mut spans) in identifiers.into_iter() {
|
||||
spans.sort();
|
||||
sess.diagnostic().span_err(
|
||||
MultiSpan::from(spans),
|
||||
&format!("identifiers cannot contain emoji: `{}`", ident),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue