diff options
| author | bors <bors@rust-lang.org> | 2013-03-19 15:43:02 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-03-19 15:43:02 -0700 |
| commit | bc211f5032dc6ca5650b2c8f437ecfd425ddfccd (patch) | |
| tree | 01f95030ad673bfbcdc3db2a599838d72b4a9678 /src/libsyntax | |
| parent | 5ae76b5babc48ff8d9ef76cd03da4836d3c74c64 (diff) | |
| parent | 14df8447445440794d363f6dc3fbb5220bb0a775 (diff) | |
| download | rust-bc211f5032dc6ca5650b2c8f437ecfd425ddfccd.tar.gz rust-bc211f5032dc6ca5650b2c8f437ecfd425ddfccd.zip | |
auto merge of #5436 : alexcrichton/rust/assert-message, r=pcwalton
This would close #2761. I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index ec693fa1f08..ad05e2f21e6 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -456,6 +456,11 @@ pub fn core_macros() -> ~str { if !$cond { ::core::sys::fail_assert(stringify!($cond), file!(), line!()) } + }; + ($cond:expr, $msg:expr) => { + if !$cond { + ::core::sys::fail_assert($msg, file!(), line!()) + } } ) |
