about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-09-14 11:39:49 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2021-11-23 20:37:24 +0000
commit5402e4833ff1a23218ae77456488d873e261591a (patch)
tree7a3a4c0da03c694a15a415967f7807dfaf274afa /compiler/rustc_interface
parent38979a3ba167e6937dee5e434f66aded57d23926 (diff)
downloadrust-5402e4833ff1a23218ae77456488d873e261591a.tar.gz
rust-5402e4833ff1a23218ae77456488d873e261591a.zip
Sort `FxHashSet`'s contents before emitting errors for consistent output
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/passes.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 67b5833ca47..d3917dfb14a 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -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),