Skip to content

Commit 733f104

Browse files
committed
Auto merge of #70833 - RalfJung:rustc-layout, r=Centril
tweak rustc_layout debug output As suggested by r? @eddyb @Centril
2 parents af89eb5 + 83fb0b1 commit 733f104

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/librustc_passes/layout_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl LayoutTest<'tcx> {
8585
sym::debug => {
8686
self.tcx.sess.span_err(
8787
item.span,
88-
&format!("layout debugging for type {:?}: {:#?}", ty, *ty_layout),
88+
&format!("layout_of({:?}) = {:#?}", ty, *ty_layout),
8989
);
9090
}
9191

src/test/ui/layout/debug.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
#![crate_type = "lib"]
44

55
#[rustc_layout(debug)]
6-
enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout debugging
6+
enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout_of
77

88
#[rustc_layout(debug)]
9-
struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout debugging
9+
struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout_of
1010

1111
#[rustc_layout(debug)]
12-
union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout debugging
12+
union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout_of
1313

1414
#[rustc_layout(debug)]
15-
type Test = Result<i32, i32>; //~ ERROR: layout debugging
15+
type Test = Result<i32, i32>; //~ ERROR: layout_of
1616

1717
#[rustc_layout(debug)]
18-
type T = impl std::fmt::Debug; //~ ERROR: layout debugging
18+
type T = impl std::fmt::Debug; //~ ERROR: layout_of
1919

2020
fn f() -> T {
2121
0i32

src/test/ui/layout/debug.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: layout debugging for type E: Layout {
1+
error: layout_of(E) = Layout {
22
fields: Arbitrary {
33
offsets: [
44
Size {
@@ -110,7 +110,7 @@ error: layout debugging for type E: Layout {
110110
LL | enum E { Foo, Bar(!, i32, i32) }
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112112

113-
error: layout debugging for type S: Layout {
113+
error: layout_of(S) = Layout {
114114
fields: Arbitrary {
115115
offsets: [
116116
Size {
@@ -164,7 +164,7 @@ error: layout debugging for type S: Layout {
164164
LL | struct S { f1: i32, f2: (), f3: i32 }
165165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166166

167-
error: layout debugging for type U: Layout {
167+
error: layout_of(U) = Layout {
168168
fields: Union(
169169
2,
170170
),
@@ -190,7 +190,7 @@ error: layout debugging for type U: Layout {
190190
LL | union U { f1: (i32, i32), f3: i32 }
191191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192192

193-
error: layout debugging for type std::result::Result<i32, i32>: Layout {
193+
error: layout_of(std::result::Result<i32, i32>) = Layout {
194194
fields: Arbitrary {
195195
offsets: [
196196
Size {
@@ -315,7 +315,7 @@ error: layout debugging for type std::result::Result<i32, i32>: Layout {
315315
LL | type Test = Result<i32, i32>;
316316
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
317317

318-
error: layout debugging for type i32: Layout {
318+
error: layout_of(i32) = Layout {
319319
fields: Union(
320320
0,
321321
),

0 commit comments

Comments
 (0)