diff options
| author | bors <bors@rust-lang.org> | 2020-04-20 05:30:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-04-20 05:30:12 +0000 |
| commit | 4ca5fd2d7b6b1d75b6cb8f679e8523fb3e7b19e2 (patch) | |
| tree | 15895a5eccc7ab4a7124fc9124b47f778618dc56 /src/test/rustdoc-ui/coverage/json.rs | |
| parent | 9b2f8dbba39dd4167f22a7026674a585c3d907d8 (diff) | |
| parent | eccb28e3d67460f77331eb5ecceab36181831946 (diff) | |
| download | rust-4ca5fd2d7b6b1d75b6cb8f679e8523fb3e7b19e2.tar.gz rust-4ca5fd2d7b6b1d75b6cb8f679e8523fb3e7b19e2.zip | |
Auto merge of #71232 - eddyb:print-const-adts, r=oli-obk
ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).
Oddly enough, we don't have any UI tests showing this off in types, only `mir-opt` tests.
However, the pretty form should show up in the test output diff of #71018, if this PR is merged first.
<hr/>
Examples of before/after:
|`Option<bool>`|
|:-:|
|`{transmute(0x01): std::option::Option<bool>}`|
| :sparkles: ↓↓↓ :sparkles: |
|`std::option::Option::<bool>::Some(true)`|
| `RawVec<u32>` |
|:-:|
| `ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::<u32>`|
| :sparkles: ↓↓↓ :sparkles: |
|`alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }`|
<hr/>
This PR is a prerequisite for #61486, *sort of*, in that we need to be able to pretty-print values in order to even consider how we might mangle them.
We still don't have pretty-printing for constants of reference types, @oli-obk has the necessary support logic in a PR but I didn't want to interfere with that.
<hr/>
Each commit should be reviewed separately, as I've fixed a couple deficiencies along the way.
r? @oli-obk cc @rust-lang/wg-mir-opt @varkor @yodaldevoid
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions
