about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-21 14:32:54 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-21 20:25:19 -0800
commit90af72378d9f848de78adc5003dff6b90f327b3c (patch)
tree24169c2dc6be5e6c80f6bc3549fb83714160723f /src/libsyntax/diagnostics/plugin.rs
parent91cec5b57e1e0961d1f75ede168d37f4748f9478 (diff)
downloadrust-90af72378d9f848de78adc5003dff6b90f327b3c.tar.gz
rust-90af72378d9f848de78adc5003dff6b90f327b3c.zip
Make diagnostic ordering deterministic
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index 0e99829fa1c..bd5247bbad6 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use std::cell::RefCell;
-use std::collections::HashMap;
+use std::collections::BTreeMap;
 use ast;
 use ast::{Ident, Name, TokenTree};
 use codemap::Span;
@@ -19,18 +19,18 @@ use parse::token;
 use ptr::P;
 
 thread_local! {
-    static REGISTERED_DIAGNOSTICS: RefCell<HashMap<Name, Option<Name>>> = {
-        RefCell::new(HashMap::new())
+    static REGISTERED_DIAGNOSTICS: RefCell<BTreeMap<Name, Option<Name>>> = {
+        RefCell::new(BTreeMap::new())
     }
 }
 thread_local! {
-    static USED_DIAGNOSTICS: RefCell<HashMap<Name, Span>> = {
-        RefCell::new(HashMap::new())
+    static USED_DIAGNOSTICS: RefCell<BTreeMap<Name, Span>> = {
+        RefCell::new(BTreeMap::new())
     }
 }
 
 fn with_registered_diagnostics<T, F>(f: F) -> T where
-    F: FnOnce(&mut HashMap<Name, Option<Name>>) -> T,
+    F: FnOnce(&mut BTreeMap<Name, Option<Name>>) -> T,
 {
     REGISTERED_DIAGNOSTICS.with(move |slot| {
         f(&mut *slot.borrow_mut())
@@ -38,7 +38,7 @@ fn with_registered_diagnostics<T, F>(f: F) -> T where
 }
 
 fn with_used_diagnostics<T, F>(f: F) -> T where
-    F: FnOnce(&mut HashMap<Name, Span>) -> T,
+    F: FnOnce(&mut BTreeMap<Name, Span>) -> T,
 {
     USED_DIAGNOSTICS.with(move |slot| {
         f(&mut *slot.borrow_mut())