Merge pull request #910 from kamalmarhubi/cancel-errors

macros: Cancel DiagnosticBuilder when not emitting error
This commit is contained in:
Nick Cameron 2016-04-08 15:41:04 +12:00
commit 6cec513c67

View File

@ -82,7 +82,10 @@ pub fn rewrite_macro(mac: &ast::Mac,
loop {
expr_vec.push(match parser.parse_expr() {
Ok(expr) => expr,
Err(..) => return None,
Err(mut e) => {
e.cancel();
return None;
}
});
match parser.token {