mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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.
This commit is contained in:
parent
38d62feec1
commit
c725926cf5
@ -529,7 +529,7 @@ pub fn std_macros() -> @str {
|
|||||||
($cond:expr) => {
|
($cond:expr) => {
|
||||||
if !$cond {
|
if !$cond {
|
||||||
::std::sys::FailWithCause::fail_with(
|
::std::sys::FailWithCause::fail_with(
|
||||||
~\"assertion failed: \" + stringify!($cond), file!(), line!())
|
\"assertion failed: \" + stringify!($cond), file!(), line!())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
($cond:expr, $msg:expr) => {
|
($cond:expr, $msg:expr) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user