Fallout from collection conventions
This commit is contained in:
parent
cf3b2e4fe6
commit
eec145be3f
101 changed files with 418 additions and 417 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue