about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-11-21 03:46:59 -0500
committerTrevor Gross <tmgross@umich.edu>2024-11-22 19:46:34 -0500
commitc1707aaf0b8da047db0c1e1d97c7fa6c3545672d (patch)
treeaab1ce855cb3c7095a7cd208159ec30057d0eafa /compiler/rustc_codegen_llvm/src/back/write.rs
parent318f96a8cf3eca5c4aaf60a992f349bce5c3fd41 (diff)
downloadrust-c1707aaf0b8da047db0c1e1d97c7fa6c3545672d.tar.gz
rust-c1707aaf0b8da047db0c1e1d97c7fa6c3545672d.zip
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>,
    }
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
0 files changed, 0 insertions, 0 deletions