rust/tests/ui/layout
Nicholas Nethercote 64ea8eb1a9 Disentangle Debug and Display for Ty.
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This
is surprising and annoying. In particular, it means `Debug` doesn't show
as much information as `Debug` for `TyKind` does. And `Debug` is used in
some user-facing error messages, which seems bad.

This commit changes the `Debug` impl for `Ty` to call the `Debug` impl
for `TyKind`. It also does a number of follow-up changes to preserve
existing output, many of which involve inserting
`with_no_trimmed_paths!` calls. It also adds `Display` impls for
`UserType` and `Canonical`.

Some tests have changes to expected output:
- Those that use the `rustc_abi(debug)` attribute.
- Those that use the `EMIT_MIR` annotation.

In each case the output is slightly uglier than before. This isn't
ideal, but it's pretty weird (particularly for the attribute) that the
output is using `Debug` in the first place. They're fairly obscure
attributes (I hadn't heard of them) so I'm not worried by this.

For `async-is-unwindsafe.stderr`, there is one line that now lacks a
full path. This is a consistency improvement, because all the other
mentions of `Context` in this test lack a path.
2023-09-11 12:51:07 +10:00
..
big-type-no-err.rs
cannot-transmute-unnormalizable-type.rs
cannot-transmute-unnormalizable-type.stderr
debug.rs rustc_layout, rustc_abi: make sure the types are well-formed 2023-09-09 17:32:12 +02:00
debug.stderr Disentangle Debug and Display for Ty. 2023-09-11 12:51:07 +10:00
enum.rs
enum.stderr
hexagon-enum.rs
hexagon-enum.stderr
homogeneous-aggr-zero-sized-c-struct.rs
homogeneous-aggr-zero-sized-c-struct.stderr
homogeneous-aggr-zero-sized-repr-rust.rs
homogeneous-aggr-zero-sized-repr-rust.stderr
issue-60431-unsized-tail-behind-projection.rs
issue-84108.rs
issue-84108.stderr
issue-96158-scalarpair-payload-might-be-uninit.rs
issue-96158-scalarpair-payload-might-be-uninit.stderr
issue-96185-overaligned-enum.rs
issue-96185-overaligned-enum.stderr
issue-112048-unsizing-field-order.rs
issue-112048-unsizing-niche.rs
issue-113941.rs
layout-cycle.rs
layout-cycle.stderr
malformed-unsized-type-in-union.rs
malformed-unsized-type-in-union.stderr
struct.rs
struct.stderr
thin-meta-implies-thin-ptr.rs
thumb-enum.rs
thumb-enum.stderr
transmute-to-tail-with-err.rs
transmute-to-tail-with-err.stderr
unsafe-cell-hides-niche.rs
valid_range_oob.rs
valid_range_oob.stderr
zero-sized-array-enum-niche.rs
zero-sized-array-enum-niche.stderr Disentangle Debug and Display for Ty. 2023-09-11 12:51:07 +10:00
zero-sized-array-union.rs
zero-sized-array-union.stderr