From 1d2a1bfa7d0f49444e6ae954a46b0df242a3738d Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 18 Sep 2018 07:08:26 +0200 Subject: [PATCH] dbg_macro: notes about VCS and log::debug!(..) --- src/libstd/macros.rs | 8 +++++--- .../ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs | 0 src/test/ui/rfc-2361-dbg-macro/dbg-macro-feature-gate.rs | 0 .../ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs | 0 .../ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs | 0 5 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/libstd/macros.rs mode change 100755 => 100644 src/test/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs mode change 100755 => 100644 src/test/ui/rfc-2361-dbg-macro/dbg-macro-feature-gate.rs mode change 100755 => 100644 src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs mode change 100755 => 100644 src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs old mode 100755 new mode 100644 index 8344c73c9bea3..34b7713ff6ff4 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -243,8 +243,10 @@ macro_rules! eprintln { /// to give up ownership, you can instead borrow with `dbg!(&expr)` /// for some expression `expr`. /// -/// and should be avoided -/// for longer periods in version control +/// Note that the macro is intended as a debugging tool and therefore you +/// should avoid having uses of it in version control for longer periods. +/// Use cases involving debug output that should be added to version control +/// may be better served by macros such as `debug!` from the `log` crate. /// /// # Stability /// @@ -261,7 +263,7 @@ macro_rules! eprintln { /// /// ```rust /// #![feature(dbg_macro)] -/// +/// /// fn foo(n: usize) { /// if let Some(_) = dbg!(n.checked_sub(4)) { /// // ... diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs old mode 100755 new mode 100644 diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-feature-gate.rs b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-feature-gate.rs old mode 100755 new mode 100644 diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs old mode 100755 new mode 100644 diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs old mode 100755 new mode 100644