提交 262d5a46 编写于 作者: R root

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
上级 58bb603e
......@@ -96,7 +96,7 @@ fn _run_fmt(fmt: &::std::fmt::Arguments) -> ! {
macro_rules! assert(
($cond:expr) => (
if !$cond {
fail!("assertion failed: {:s}", stringify!($cond))
fail!(concat!("assertion failed: ", stringify!($cond)))
}
);
($cond:expr, $($arg:expr),+) => (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册