diff --git a/src/librustc_passes/layout_test.rs b/src/librustc_passes/layout_test.rs index 867cec38a8b..22ce909083d 100644 --- a/src/librustc_passes/layout_test.rs +++ b/src/librustc_passes/layout_test.rs @@ -85,7 +85,7 @@ fn dump_layout_of(&self, item_def_id: DefId, item: &hir::Item<'tcx>, attr: &Attr sym::debug => { self.tcx.sess.span_err( item.span, - &format!("layout debugging: {:#?}", *ty_layout), + &format!("layout debugging for type {:?}: {:#?}", ty, *ty_layout), ); } diff --git a/src/test/ui/layout/debug.stderr b/src/test/ui/layout/debug.stderr index 3d407653755..3539cea5ea3 100644 --- a/src/test/ui/layout/debug.stderr +++ b/src/test/ui/layout/debug.stderr @@ -1,4 +1,4 @@ -error: layout debugging: Layout { +error: layout debugging for type E: Layout { fields: Arbitrary { offsets: [ Size { @@ -110,7 +110,7 @@ error: layout debugging: Layout { LL | enum E { Foo, Bar(!, i32, i32) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: layout debugging: Layout { +error: layout debugging for type S: Layout { fields: Arbitrary { offsets: [ Size { @@ -164,7 +164,7 @@ error: layout debugging: Layout { LL | struct S { f1: i32, f2: (), f3: i32 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: layout debugging: Layout { +error: layout debugging for type U: Layout { fields: Union( 2, ), @@ -190,7 +190,7 @@ error: layout debugging: Layout { LL | union U { f1: (i32, i32), f3: i32 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: layout debugging: Layout { +error: layout debugging for type std::result::Result: Layout { fields: Arbitrary { offsets: [ Size { @@ -315,7 +315,7 @@ error: layout debugging: Layout { LL | type Test = Result; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: layout debugging: Layout { +error: layout debugging for type i32: Layout { fields: Union( 0, ),