about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-07 00:02:18 +0000
committerbors <bors@rust-lang.org>2014-11-07 00:02:18 +0000
commit45cbdec4174778bf915f17561ef971c068a7fcbc (patch)
tree9516c60b7323f1233858665501a5029c9c3f90f0 /src/libsyntax/diagnostics
parent8ed288edb27fc83b15a549af69c82b5bb4f8ac1e (diff)
parentd27039d701a3c6e97f19e41436d06ed42c0f5f8a (diff)
downloadrust-45cbdec4174778bf915f17561ef971c068a7fcbc.tar.gz
rust-45cbdec4174778bf915f17561ef971c068a7fcbc.zip
auto merge of #18719 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libsyntax/diagnostics')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index d9d549f6841..d077fbd7bf0 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -63,7 +63,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
         ()
     });
     with_used_diagnostics(|diagnostics| {
-        match diagnostics.swap(code.name, span) {
+        match diagnostics.insert(code.name, span) {
             Some(previous_span) => {
                 ecx.span_warn(span, format!(
                     "diagnostic code {} already used", token::get_ident(code).get()
@@ -93,7 +93,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
         _ => unreachable!()
     };
     with_registered_diagnostics(|diagnostics| {
-        if !diagnostics.insert(code.name, description) {
+        if diagnostics.insert(code.name, description).is_some() {
             ecx.span_err(span, format!(
                 "diagnostic code {} already registered", token::get_ident(*code).get()
             ).as_slice());