libsyntax: Implement assert as a macro (called fail_unless! on a transitionary basis to avoid conflicting with the keyword right now). r=brson
This commit is contained in:
@@ -300,6 +300,14 @@ fn core_macros() -> ~str {
|
||||
)
|
||||
)
|
||||
|
||||
macro_rules! fail_unless(
|
||||
($cond:expr) => {
|
||||
if !$cond {
|
||||
die!(~\"assertion failed: \" + stringify!($cond))
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
macro_rules! condition (
|
||||
|
||||
{ $c:ident: $in:ty -> $out:ty; } => {
|
||||
|
||||
Reference in New Issue
Block a user