std: Use concat! and stringify! to simplify the most common assert! case.
With no custom message, we should just use concat! + stringify! for `assert!(expr)`. Inspired by issue #16625
This commit is contained in:
parent
58bb603ea7
commit
262d5a4686
|
@ -96,7 +96,7 @@ macro_rules! fail(
|
||||||
macro_rules! assert(
|
macro_rules! assert(
|
||||||
($cond:expr) => (
|
($cond:expr) => (
|
||||||
if !$cond {
|
if !$cond {
|
||||||
fail!("assertion failed: {:s}", stringify!($cond))
|
fail!(concat!("assertion failed: ", stringify!($cond)))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
($cond:expr, $($arg:expr),+) => (
|
($cond:expr, $($arg:expr),+) => (
|
||||||
|
|
Loading…
Reference in New Issue