]> git.lizzy.rs Git - rust.git/commitdiff
tweak rustc_layout debug output
authorRalf Jung <post@ralfj.de>
Mon, 6 Apr 2020 07:22:48 +0000 (09:22 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 6 Apr 2020 07:22:48 +0000 (09:22 +0200)
src/librustc_passes/layout_test.rs
src/test/ui/layout/debug.rs
src/test/ui/layout/debug.stderr

index 22ce909083d915c3311a5daf6cf2f3fef4799963..dbc39169f2b70e7fd6fd0ff015729092a01b5b37 100644 (file)
@@ -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 for type {:?}: {:#?}", ty, *ty_layout),
+                                &format!("layout_of({:?}) = {:#?}", ty, *ty_layout),
                             );
                         }
 
index 034ed3190c13f84449de382643f90dffe032dc3c..299151df6649339dc6ed3bda802793e040a83668 100644 (file)
@@ -3,19 +3,19 @@
 #![crate_type = "lib"]
 
 #[rustc_layout(debug)]
-enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout debugging
+enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout_of
 
 #[rustc_layout(debug)]
-struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout debugging
+struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout_of
 
 #[rustc_layout(debug)]
-union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout debugging
+union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout_of
 
 #[rustc_layout(debug)]
-type Test = Result<i32, i32>; //~ ERROR: layout debugging
+type Test = Result<i32, i32>; //~ ERROR: layout_of
 
 #[rustc_layout(debug)]
-type T = impl std::fmt::Debug; //~ ERROR: layout debugging
+type T = impl std::fmt::Debug; //~ ERROR: layout_of
 
 fn f() -> T {
     0i32
index 3539cea5ea3184acc5e450cb43a6d2ad768f7d5b..153dec594d32e669f966ff5d8253685d98c2f4bd 100644 (file)
@@ -1,4 +1,4 @@
-error: layout debugging for type E: Layout {
+error: layout_of(E) = Layout {
     fields: Arbitrary {
         offsets: [
             Size {
@@ -110,7 +110,7 @@ error: layout debugging for type E: Layout {
 LL | enum E { Foo, Bar(!, i32, i32) }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: layout debugging for type S: Layout {
+error: layout_of(S) = Layout {
     fields: Arbitrary {
         offsets: [
             Size {
@@ -164,7 +164,7 @@ error: layout debugging for type S: Layout {
 LL | struct S { f1: i32, f2: (), f3: i32 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: layout debugging for type U: Layout {
+error: layout_of(U) = Layout {
     fields: Union(
         2,
     ),
@@ -190,7 +190,7 @@ error: layout debugging for type U: Layout {
 LL | union U { f1: (i32, i32), f3: i32 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: layout debugging for type std::result::Result<i32, i32>: Layout {
+error: layout_of(std::result::Result<i32, i32>) = Layout {
     fields: Arbitrary {
         offsets: [
             Size {
@@ -315,7 +315,7 @@ error: layout debugging for type std::result::Result<i32, i32>: Layout {
 LL | type Test = Result<i32, i32>;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: layout debugging for type i32: Layout {
+error: layout_of(i32) = Layout {
     fields: Union(
         0,
     ),