Skip to content

Commit

Permalink
allow trailing comma in check!-family macros (FuelLabs#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
canndrew authored Dec 14, 2021
1 parent 53dd3d0 commit 5418088
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core_lang/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt;
use thiserror::Error;

macro_rules! check {
($fn_expr: expr, $error_recovery: expr, $warnings: ident, $errors: ident) => {{
($fn_expr: expr, $error_recovery: expr, $warnings: ident, $errors: ident $(,)?) => {{
let mut res = $fn_expr;
$warnings.append(&mut res.warnings);
$errors.append(&mut res.errors);
Expand All @@ -21,7 +21,7 @@ macro_rules! check {
}

macro_rules! check_std_result {
($result_expr: expr, $warnings: ident, $errors: ident) => {{
($result_expr: expr, $warnings: ident, $errors: ident $(,)?) => {{
match $result_expr {
Ok(res) => res,
Err(e) => {
Expand All @@ -33,7 +33,7 @@ macro_rules! check_std_result {
}

macro_rules! assert_or_warn {
($bool_expr: expr, $warnings: ident, $span: expr, $warning: expr) => {
($bool_expr: expr, $warnings: ident, $span: expr, $warning: expr $(,)?) => {
if !$bool_expr {
use crate::error::CompileWarning;
$warnings.push(CompileWarning {
Expand Down

0 comments on commit 5418088

Please sign in to comment.