diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 12667036444e6..c410c2d900470 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -120,6 +120,9 @@ macro_rules! assert_eq { } } }); + ($left:expr, $right:expr,) => ({ + assert_eq!($left, $right) + }); ($left:expr, $right:expr, $($arg:tt)+) => ({ match (&($left), &($right)) { (left_val, right_val) => { @@ -168,6 +171,9 @@ macro_rules! assert_ne { } } }); + ($left:expr, $right:expr,) => { + assert_ne!($left, $right) + }; ($left:expr, $right:expr, $($arg:tt)+) => ({ match (&($left), &($right)) { (left_val, right_val) => { diff --git a/src/test/ui/macros/assert_eq_trailing_comma.rs b/src/test/run-pass/assert-eq-trailing-comma.rs similarity index 100% rename from src/test/ui/macros/assert_eq_trailing_comma.rs rename to src/test/run-pass/assert-eq-trailing-comma.rs diff --git a/src/test/ui/macros/assert_ne_trailing_comma.rs b/src/test/run-pass/assert-ne-trailing-comma.rs similarity index 100% rename from src/test/ui/macros/assert_ne_trailing_comma.rs rename to src/test/run-pass/assert-ne-trailing-comma.rs diff --git a/src/test/ui/macros/assert_eq_trailing_comma.stderr b/src/test/ui/macros/assert_eq_trailing_comma.stderr deleted file mode 100644 index 1b46e94584e6b..0000000000000 --- a/src/test/ui/macros/assert_eq_trailing_comma.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: unexpected end of macro invocation - --> $DIR/assert_eq_trailing_comma.rs:12:20 - | -12 | assert_eq!(1, 1,); - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/macros/assert_ne_trailing_comma.stderr b/src/test/ui/macros/assert_ne_trailing_comma.stderr deleted file mode 100644 index 33d2cb0ed8242..0000000000000 --- a/src/test/ui/macros/assert_ne_trailing_comma.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: unexpected end of macro invocation - --> $DIR/assert_ne_trailing_comma.rs:12:20 - | -12 | assert_ne!(1, 2,); - | ^ - -error: aborting due to previous error -