diff options
| author | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-06-17 19:37:29 +0200 |
|---|---|---|
| committer | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-06-22 10:58:27 +0200 |
| commit | 29ce695cd4e148682b0d439cc47dd36edb494673 (patch) | |
| tree | 1b3bbc40f475a5ffd4ff7a39878312178aa51733 /library/std/src/macros.rs | |
| parent | b1d18129d199c095372c39f75a5c3fb31ea166c2 (diff) | |
| download | rust-29ce695cd4e148682b0d439cc47dd36edb494673.tar.gz rust-29ce695cd4e148682b0d439cc47dd36edb494673.zip | |
Stop dbg! macro yapping about format modifiers
Diffstat (limited to 'library/std/src/macros.rs')
| -rw-r--r-- | library/std/src/macros.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index f008d42804c..25e2b7ea137 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -363,7 +363,14 @@ macro_rules! dbg { match $val { tmp => { $crate::eprintln!("[{}:{}:{}] {} = {:#?}", - $crate::file!(), $crate::line!(), $crate::column!(), $crate::stringify!($val), &tmp); + $crate::file!(), + $crate::line!(), + $crate::column!(), + $crate::stringify!($val), + // The `&T: Debug` check happens here (not in the format literal desugaring) + // to avoid format literal related messages and suggestions. + &&tmp as &dyn $crate::fmt::Debug, + ); tmp } } |
