Skip to content

Commit 6cec513

Browse files
committed
Merge pull request #910 from kamalmarhubi/cancel-errors
macros: Cancel DiagnosticBuilder when not emitting error
2 parents c59d96a + a8c27c7 commit 6cec513

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/macros.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ pub fn rewrite_macro(mac: &ast::Mac,
8282
loop {
8383
expr_vec.push(match parser.parse_expr() {
8484
Ok(expr) => expr,
85-
Err(..) => return None,
85+
Err(mut e) => {
86+
e.cancel();
87+
return None;
88+
}
8689
});
8790

8891
match parser.token {

0 commit comments

Comments
 (0)