diff options
| author | Alexis Beingessner <a.beingessner@gmail.com> | 2014-11-06 12:25:16 -0500 |
|---|---|---|
| committer | Alexis Beingessner <a.beingessner@gmail.com> | 2014-11-06 12:26:08 -0500 |
| commit | eec145be3f5e5f763e61749a6737f90df8504e05 (patch) | |
| tree | ff30ca7802a92034a30cb57dcf4c89733b2952b6 /src/libsyntax/diagnostics | |
| parent | cf3b2e4fe6044cce018b723de9b21c500c6eac41 (diff) | |
| download | rust-eec145be3f5e5f763e61749a6737f90df8504e05.tar.gz rust-eec145be3f5e5f763e61749a6737f90df8504e05.zip | |
Fallout from collection conventions
Diffstat (limited to 'src/libsyntax/diagnostics')
| -rw-r--r-- | src/libsyntax/diagnostics/plugin.rs | 4 |
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()); |
