]>
git.proxmox.com Git - rustc.git/blob - vendor/opaque-debug/src/lib.rs
1 //! Macro for opaque `Debug` trait implementation.
5 pub extern crate core
as __core
;
7 /// Macro for defining opaque `Debug` implementation.
9 /// It will use the following format: "StructName { ... }". While it's
10 /// convinient to have it (e.g. for including into other structs), it could be
11 /// undesirable to leak internal state, which can happen for example through
12 /// uncareful logging.
14 macro_rules
! implement
{
16 impl $
crate::__core
::fmt
::Debug
for $
struct {
17 fn fmt(&self, f
: &mut $
crate::__core
::fmt
::Formatter
)
18 -> Result
<(), $
crate::__core
::fmt
::Error
>
20 write
!(f
, concat
!(stringify
!($
struct), " {{ ... }}"))