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.
This commit is contained in:
bors 2013-03-19 15:43:02 -07:00
commit bc211f5032
2 changed files with 20 additions and 0 deletions

View file

@ -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!())
}
}
)