Skip to content

tweak rustc_layout debug output #70833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_passes/layout_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl LayoutTest<'tcx> {
sym::debug => {
self.tcx.sess.span_err(
item.span,
&format!("layout debugging for type {:?}: {:#?}", ty, *ty_layout),
&format!("layout_of({:?}) = {:#?}", ty, *ty_layout),
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/layout/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/layout/debug.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: layout debugging for type E: Layout {
error: layout_of(E) = Layout {
fields: Arbitrary {
offsets: [
Size {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
),
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
),
Expand Down