Skip to content

Commit 1d2a1bf

Browse files
committed
dbg_macro: notes about VCS and log::debug!(..)
1 parent a9d2f38 commit 1d2a1bf

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

src/libstd/macros.rs

100755100644
+5-3
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,10 @@ macro_rules! eprintln {
243243
/// to give up ownership, you can instead borrow with `dbg!(&expr)`
244244
/// for some expression `expr`.
245245
///
246-
/// and should be avoided
247-
/// for longer periods in version control
246+
/// Note that the macro is intended as a debugging tool and therefore you
247+
/// should avoid having uses of it in version control for longer periods.
248+
/// Use cases involving debug output that should be added to version control
249+
/// may be better served by macros such as `debug!` from the `log` crate.
248250
///
249251
/// # Stability
250252
///
@@ -261,7 +263,7 @@ macro_rules! eprintln {
261263
///
262264
/// ```rust
263265
/// #![feature(dbg_macro)]
264-
///
266+
///
265267
/// fn foo(n: usize) {
266268
/// if let Some(_) = dbg!(n.checked_sub(4)) {
267269
/// // ...

src/test/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs

100755100644
File mode changed.

src/test/ui/rfc-2361-dbg-macro/dbg-macro-feature-gate.rs

100755100644
File mode changed.

src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs

100755100644
File mode changed.

src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs

100755100644
File mode changed.

0 commit comments

Comments
 (0)