From f10e44420a072881cce6d7819d2b2bfb99df90df Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 29 Mar 2019 15:56:22 +0100 Subject: [PATCH 1/5] Edited the dbg! docs stating that dbg! works the same way in release builds. --- src/libstd/macros.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 9d0eb2e6b1cef..ee5a8e6631ec7 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -231,10 +231,13 @@ macro_rules! eprintln { /// to give up ownership, you can instead borrow with `dbg!(&expr)` /// for some expression `expr`. /// +/// The `dbg!` macro works exactly the same in release builds. This is useful when debugging issues +/// that only occur in release builds or when debugging in release mode is significantly faster. +/// /// 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. +/// are better served by macros such as [`debug!`][debug-log] from the [`log`][log] crate. /// /// # Stability /// @@ -306,6 +309,8 @@ macro_rules! eprintln { /// ``` /// /// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr) +/// [debug-log]: https://docs.rs/log/*/log/macro.debug.html +/// [log]: https://docs.rs/log/ #[macro_export] #[stable(feature = "dbg_macro", since = "1.32.0")] macro_rules! dbg { From 9240092fe3bf32803ac9f9a247a098844d6f4780 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 29 Mar 2019 16:18:24 +0100 Subject: [PATCH 2/5] Adjusted the indentation. --- src/libstd/macros.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index ee5a8e6631ec7..03d2a3072167c 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -231,8 +231,9 @@ macro_rules! eprintln { /// to give up ownership, you can instead borrow with `dbg!(&expr)` /// for some expression `expr`. /// -/// The `dbg!` macro works exactly the same in release builds. This is useful when debugging issues -/// that only occur in release builds or when debugging in release mode is significantly faster. +/// The `dbg!` macro works exactly the same in release builds. +/// This is useful when debugging issues that only occur in release builds or when debugging in +/// release mode is significantly faster. /// /// 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. From fe210d0df17b16d3afa3ec5462767bd9f20a4c0c Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 29 Mar 2019 16:24:13 +0100 Subject: [PATCH 3/5] Update src/libstd/macros.rs Wrapped lines earlier such that it is more coherent with the rest of the text. Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com> --- src/libstd/macros.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 03d2a3072167c..37e88ee620993 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -232,7 +232,8 @@ macro_rules! eprintln { /// for some expression `expr`. /// /// The `dbg!` macro works exactly the same in release builds. -/// This is useful when debugging issues that only occur in release builds or when debugging in +/// This is useful when debugging issues that only occur in release +/// builds or when debugging in release mode is significantly faster. /// release mode is significantly faster. /// /// Note that the macro is intended as a debugging tool and therefore you From 8705de49e1de83f357fcd6224f9e0a5e266915da Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 29 Mar 2019 16:25:38 +0100 Subject: [PATCH 4/5] Update src/libstd/macros.rs Removed duplicate line. Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com> --- src/libstd/macros.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 37e88ee620993..bc0a97939d881 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -234,7 +234,6 @@ macro_rules! eprintln { /// The `dbg!` macro works exactly the same in release builds. /// This is useful when debugging issues that only occur in release /// builds or when debugging in release mode is significantly faster. -/// release mode is significantly faster. /// /// 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. From 4c5ef86cf5ed137912ff5181e3807b840efc6bf8 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 30 Mar 2019 09:37:16 +0100 Subject: [PATCH 5/5] Updated the reference style and wording. --- src/libstd/macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 37e88ee620993..a6eed2b1af040 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -239,7 +239,7 @@ macro_rules! eprintln { /// 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 -/// are better served by macros such as [`debug!`][debug-log] from the [`log`][log] crate. +/// are better served by macros such as [`debug!`] from the [`log`] crate. /// /// # Stability /// @@ -311,8 +311,8 @@ macro_rules! eprintln { /// ``` /// /// [stderr]: https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr) -/// [debug-log]: https://docs.rs/log/*/log/macro.debug.html -/// [log]: https://docs.rs/log/ +/// [`debug!`]: https://docs.rs/log/*/log/macro.debug.html +/// [`log`]: https://crates.io/crates/log #[macro_export] #[stable(feature = "dbg_macro", since = "1.32.0")] macro_rules! dbg {