Skip to content

Commit c725926

Browse files
committed
Reduce code bloat from assert!()
Assertions without a message get a generated message that consists of a prefix plus the stringified expression that is being asserted. That prefix is currently a unique string, while a static string would be sufficient and needs less code.
1 parent 38d62fe commit c725926

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax/ext/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ pub fn std_macros() -> @str {
529529
($cond:expr) => {
530530
if !$cond {
531531
::std::sys::FailWithCause::fail_with(
532-
~\"assertion failed: \" + stringify!($cond), file!(), line!())
532+
\"assertion failed: \" + stringify!($cond), file!(), line!())
533533
}
534534
};
535535
($cond:expr, $msg:expr) => {

0 commit comments

Comments
 (0)