Skip to content

Commit f10e444

Browse files
author
Christian
committed
Edited the dbg! docs stating that dbg! works the same way in release builds.
1 parent cd45b19 commit f10e444

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libstd/macros.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,13 @@ macro_rules! eprintln {
231231
/// to give up ownership, you can instead borrow with `dbg!(&expr)`
232232
/// for some expression `expr`.
233233
///
234+
/// The `dbg!` macro works exactly the same in release builds. This is useful when debugging issues
235+
/// that only occur in release builds or when debugging in release mode is significantly faster.
236+
///
234237
/// Note that the macro is intended as a debugging tool and therefore you
235238
/// should avoid having uses of it in version control for longer periods.
236239
/// Use cases involving debug output that should be added to version control
237-
/// may be better served by macros such as `debug!` from the `log` crate.
240+
/// are better served by macros such as [`debug!`][debug-log] from the [`log`][log] crate.
238241
///
239242
/// # Stability
240243
///
@@ -306,6 +309,8 @@ macro_rules! eprintln {
306309
/// ```
307310
///
308311
/// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)
312+
/// [debug-log]: https://docs.rs/log/*/log/macro.debug.html
313+
/// [log]: https://docs.rs/log/
309314
#[macro_export]
310315
#[stable(feature = "dbg_macro", since = "1.32.0")]
311316
macro_rules! dbg {

0 commit comments

Comments
 (0)