Skip to content

Commit 59da4e0

Browse files
committed
auto merge of #8419 : cmr/rust/fix-rtdebug, r=brson
It now actually does logging, and is compiled out when `--cfg rtdebug` is not given to the libstd build, which it isn't by default. This makes the rt benchmarks 18-50% faster.
2 parents 3504027 + 4be086b commit 59da4e0

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/libstd/macros.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,12 @@ macro_rules! rterrln (
1616
} )
1717
)
1818

19-
// Some basic logging
20-
macro_rules! rtdebug_ (
21-
($( $arg:expr),+) => ( {
22-
rterrln!( $($arg),+ )
23-
} )
24-
)
25-
26-
// An alternate version with no output, for turning off logging. An
27-
// earlier attempt that did not call the fmt! macro was insufficient,
28-
// as a case of the "let bind each variable" approach eventually
29-
// failed without an error message describing the invocation site.
19+
// Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
3020
macro_rules! rtdebug (
3121
($( $arg:expr),+) => ( {
32-
let _x = fmt!( $($arg),+ );
22+
if cfg!(rtdebug) {
23+
rterrln!( $($arg),+ )
24+
}
3325
})
3426
)
3527

0 commit comments

Comments
 (0)