diff options
| author | Keegan McAllister <kmcallister@mozilla.com> | 2015-01-08 12:21:51 -0800 |
|---|---|---|
| committer | Keegan McAllister <kmcallister@mozilla.com> | 2015-01-09 11:06:17 -0800 |
| commit | 128e7ff53b9e7330ca78f961030ac307f5a6fc47 (patch) | |
| tree | 8b660249dddff582b5c06c147312e0533d7a9c95 /src/libcore | |
| parent | 2e2372c6c4a265992b0eb615ea9fdee4ab999143 (diff) | |
| download | rust-128e7ff53b9e7330ca78f961030ac307f5a6fc47.tar.gz rust-128e7ff53b9e7330ca78f961030ac307f5a6fc47.zip | |
Re-reduce libstd macro duplication
The libstd definitions move to libcore, which causes some minor updates there.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/macros.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index f6415518864..3d3b9f8cf65 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -49,15 +49,16 @@ macro_rules! panic { /// assert!(a + b == 30, "a = {}, b = {}", a, b); /// ``` #[macro_export] +#[stable] macro_rules! assert { ($cond:expr) => ( if !$cond { panic!(concat!("assertion failed: ", stringify!($cond))) } ); - ($cond:expr, $($arg:expr),+) => ( + ($cond:expr, $($arg:tt)+) => ( if !$cond { - panic!($($arg),+) + panic!($($arg)+) } ); } @@ -75,6 +76,7 @@ macro_rules! assert { /// assert_eq!(a, b); /// ``` #[macro_export] +#[stable] macro_rules! assert_eq { ($left:expr , $right:expr) => ({ match (&($left), &($right)) { @@ -116,6 +118,7 @@ macro_rules! assert_eq { /// debug_assert!(a + b == 30, "a = {}, b = {}", a, b); /// ``` #[macro_export] +#[stable] macro_rules! debug_assert { ($($arg:tt)*) => (if cfg!(not(ndebug)) { assert!($($arg)*); }) } @@ -227,6 +230,7 @@ macro_rules! writeln { /// } /// ``` #[macro_export] +#[unstable = "relationship with panic is unclear"] macro_rules! unreachable { () => ({ panic!("internal error: entered unreachable code") @@ -242,6 +246,7 @@ macro_rules! unreachable { /// A standardised placeholder for marking unfinished code. It panics with the /// message `"not yet implemented"` when executed. #[macro_export] +#[unstable = "relationship with panic is unclear"] macro_rules! unimplemented { () => (panic!("not yet implemented")) } |
