Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
std: Use concat! and stringify! to simplify the most common assert! c…
…ase.

With no custom message, we should just use concat! + stringify! for
`assert!(expr)`.

Inspired by issue #16625
  • Loading branch information
root committed Aug 23, 2014
commit 262d5a4686c80675fe5bfcb79b26b341b9a0bf7a
2 changes: 1 addition & 1 deletion src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ macro_rules! fail(
macro_rules! assert(
($cond:expr) => (
if !$cond {
fail!("assertion failed: {:s}", stringify!($cond))
fail!(concat!("assertion failed: ", stringify!($cond)))
}
);
($cond:expr, $($arg:expr),+) => (
Expand Down