Skip to content

Commit c556ca9

Browse files
committed
auto merge of #16703 : bluss/rust/assert-bloat, r=huonw
With no custom message, we should just use concat! + stringify! for `assert!(expr)` to avoid the string formatting code path. Inspired by issue #16625
2 parents d0c3142 + 262d5a4 commit c556ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ macro_rules! fail(
9696
macro_rules! assert(
9797
($cond:expr) => (
9898
if !$cond {
99-
fail!("assertion failed: {:s}", stringify!($cond))
99+
fail!(concat!("assertion failed: ", stringify!($cond)))
100100
}
101101
);
102102
($cond:expr, $($arg:expr),+) => (

0 commit comments

Comments
 (0)