1
Fork 0

Make error code registration work again. #19624

This commit is contained in:
Brian Anderson 2015-01-16 15:54:58 -08:00
parent a0f86de497
commit 953d6dfd7e
11 changed files with 128 additions and 80 deletions

View file

@ -65,6 +65,13 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
}
()
});
with_registered_diagnostics(|diagnostics| {
if !diagnostics.contains_key(&code.name) {
ecx.span_err(span, &format!(
"used diagnostic code {} not registered", token::get_ident(code).get()
)[]);
}
});
MacExpr::new(quote_expr!(ecx, ()))
}