about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-26 12:03:42 -0500
committerGitHub <noreply@github.com>2024-11-26 12:03:42 -0500
commit3013cd83ccb67d7988440e9fa7d9d7df6980bc83 (patch)
tree1eb0410069c19a91c06c93a08efe37ab59c4b9d8 /compiler/rustc_codegen_llvm/src/back/write.rs
parentf010e2dc5746bbf28ab95d4718ace42146c47b51 (diff)
parentc1707aaf0b8da047db0c1e1d97c7fa6c3545672d (diff)
downloadrust-3013cd83ccb67d7988440e9fa7d9d7df6980bc83.tar.gz
rust-3013cd83ccb67d7988440e9fa7d9d7df6980bc83.zip
Rollup merge of #133282 - tgross35:maybe-uninit-debug, r=Amanieu
Shorten the `MaybeUninit` `Debug` implementation

Currently the `Debug` implementation for `MaybeUninit` winds up being pretty verbose. This struct:

```rust
#[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