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:
commit
bc211f5032
2 changed files with 20 additions and 0 deletions
|
|
@ -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!())
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue