diff options
| author | Esteban Kuber <esteban@kuber.com.ar> | 2021-09-14 11:39:49 +0000 |
|---|---|---|
| committer | Esteban Kuber <esteban@kuber.com.ar> | 2021-11-23 20:37:24 +0000 |
| commit | 5402e4833ff1a23218ae77456488d873e261591a (patch) | |
| tree | 7a3a4c0da03c694a15a415967f7807dfaf274afa /compiler/rustc_interface | |
| parent | 38979a3ba167e6937dee5e434f66aded57d23926 (diff) | |
| download | rust-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.rs | 5 |
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), |
