rust/library/core/src/mem
Trevor Gross c1707aaf0b Shorten the MaybeUninit Debug implementation
Currently the `Debug` implementation for `MaybeUninit` winds up being
pretty verbose. This struct:

    #[derive(Debug)]
    pub struct Foo {
        pub a: u32,
        pub b: &'static str,
        pub c: MaybeUninit<u32>,
        pub d: MaybeUninit<String>,
    }

Prints as:

    Foo {
        a: 0,
        b: "hello",
        c: core::mem::maybe_uninit::MaybeUninit<u32>,
        d: core::mem::maybe_uninit::MaybeUninit<alloc::string::String>,
    }

The goal is just to be a standin for content so the path prefix doesn't
add any useful information. Change the implementation to trim
`MaybeUninit`'s leading path, meaning the new result is now:

    Foo {
        a: 0,
        b: "hello",
        c: MaybeUninit<u32>,
        d: MaybeUninit<alloc::string::String>,
    }
2024-11-22 19:46:34 -05:00
..
manually_drop.rs Rollup merge of #130279 - theemathas:manually-drop-docs, r=thomcc,traviscross 2024-09-27 00:43:30 +02:00
maybe_uninit.rs Shorten the MaybeUninit Debug implementation 2024-11-22 19:46:34 -05:00
mod.rs use semantic line break 2024-10-31 17:27:31 -05:00
transmutability.rs update cfgs 2024-09-05 17:24:01 +01:00