diff options
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 } } |
