Align multiline messages to their label (add left margin)

This commit is contained in:
Esteban Kuber 2021-10-13 13:58:41 +00:00
parent 563db4245b
commit 8f433adf75
12 changed files with 1310 additions and 1297 deletions

View File

@ -1266,22 +1266,37 @@ impl EmitterWriter {
}
self.msg_to_buffer(&mut buffer, msg, max_line_num_len, "note", None);
} else {
let mut label_width = 0;
// The failure note level itself does not provide any useful diagnostic information
if *level != Level::FailureNote {
buffer.append(0, level.to_str(), Style::Level(*level));
label_width += level.to_str().len();
}
// only render error codes, not lint codes
if let Some(DiagnosticId::Error(ref code)) = *code {
buffer.append(0, "[", Style::Level(*level));
buffer.append(0, &code, Style::Level(*level));
buffer.append(0, "]", Style::Level(*level));
label_width += 2 + code.len();
}
let header_style = if is_secondary { Style::HeaderMsg } else { Style::MainHeaderMsg };
if *level != Level::FailureNote {
buffer.append(0, ": ", header_style);
label_width += 2;
}
for &(ref text, _) in msg.iter() {
buffer.append(0, &replace_tabs(text), header_style);
// Account for newlines to align output to its label.
for (line, text) in replace_tabs(text).lines().enumerate() {
buffer.append(
0 + line,
&format!(
"{}{}",
if line == 0 { String::new() } else { " ".repeat(label_width) },
text
),
header_style,
);
}
}
}

View File

@ -16,15 +16,15 @@ LL | bug!();
= note: this error originates in the macro `bug` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected token: `{
let res =
::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
&match (&"u8",) {
_args =>
[::core::fmt::ArgumentV1::new(_args.0,
::core::fmt::Display::fmt)],
}));
res
}.as_str()`
let res =
::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
&match (&"u8",) {
_args =>
[::core::fmt::ArgumentV1::new(_args.0,
::core::fmt::Display::fmt)],
}));
res
}.as_str()`
--> $DIR/key-value-expansion.rs:48:23
|
LL | doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}

View File

@ -1,5 +1,4 @@
error: <unknown>:0:0: in function test i32 (i32, i32, i32, i32, i32): call to non-secure function would require passing arguments on stack
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack
error: aborting due to previous error

View File

@ -1,345 +1,345 @@
error: layout_of(E) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 4,
},
},
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
Size {
raw: 4,
},
Size {
raw: 8,
},
],
memory_index: [
0,
1,
2,
],
},
variants: Single {
index: 1,
},
abi: Uninhabited,
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 12,
},
},
],
},
abi: Aggregate {
sized: true,
},
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 12,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 4,
},
},
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
Size {
raw: 4,
},
Size {
raw: 8,
},
],
memory_index: [
0,
1,
2,
],
},
variants: Single {
index: 1,
},
abi: Uninhabited,
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 12,
},
},
],
},
abi: Aggregate {
sized: true,
},
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 12,
},
}
--> $DIR/debug.rs:6:1
|
LL | enum E { Foo, Bar(!, i32, i32) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(S) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
Size {
raw: 0,
},
Size {
raw: 4,
},
],
memory_index: [
1,
0,
2,
],
},
variants: Single {
index: 0,
},
abi: ScalarPair(
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
Size {
raw: 0,
},
Size {
raw: 4,
},
],
memory_index: [
1,
0,
2,
],
},
variants: Single {
index: 0,
},
abi: ScalarPair(
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
--> $DIR/debug.rs:9:1
|
LL | struct S { f1: i32, f2: (), f3: i32 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(U) = Layout {
fields: Union(
2,
),
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
fields: Union(
2,
),
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
--> $DIR/debug.rs:12:1
|
LL | union U { f1: (i32, i32), f3: i32 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(std::result::Result<i32, i32>) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
],
memory_index: [
0,
],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
},
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
],
memory_index: [
0,
],
},
variants: Single {
index: 1,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
},
],
},
abi: ScalarPair(
Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
],
memory_index: [
0,
],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
},
Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 4,
},
],
memory_index: [
0,
],
},
variants: Single {
index: 1,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
},
],
},
abi: ScalarPair(
Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 0..=1,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 8,
},
}
--> $DIR/debug.rs:15:1
|
LL | type Test = Result<i32, i32>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(i32) = Layout {
fields: Primitive,
variants: Single {
index: 0,
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 4,
},
}
fields: Primitive,
variants: Single {
index: 0,
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 0..=4294967295,
},
),
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: $PREF_ALIGN,
},
size: Size {
raw: 4,
},
}
--> $DIR/debug.rs:18:1
|
LL | type T = impl std::fmt::Debug;

View File

@ -1,438 +1,438 @@
error: layout_of(A) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
}
--> $DIR/hexagon-enum.rs:16:1
|
LL | enum A { Apple }
| ^^^^^^^^^^^^^^^^
error: layout_of(B) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 0,
},
},
size: Size {
raw: 1,
},
}
--> $DIR/hexagon-enum.rs:20:1
|
LL | enum B { Banana = 255, }
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(C) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 1,
},
},
size: Size {
raw: 2,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 1,
},
},
size: Size {
raw: 2,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 1,
},
},
size: Size {
raw: 2,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 1,
},
},
size: Size {
raw: 2,
},
}
--> $DIR/hexagon-enum.rs:24:1
|
LL | enum C { Chaenomeles = 256, }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(P) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
--> $DIR/hexagon-enum.rs:28:1
|
LL | enum P { Peach = 0x1000_0000isize, }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(T) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
--> $DIR/hexagon-enum.rs:34:1
|
LL | enum T { Tangerine = TANGERINE as isize }

View File

@ -1,438 +1,438 @@
error: layout_of(A) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 0..=0,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
}
--> $DIR/thumb-enum.rs:16:1
|
LL | enum A { Apple }
| ^^^^^^^^^^^^^^^^
error: layout_of(B) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I8,
false,
),
valid_range: 255..=255,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 1,
},
}
--> $DIR/thumb-enum.rs:20:1
|
LL | enum B { Banana = 255, }
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(C) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 2,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 2,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 2,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I16,
false,
),
valid_range: 256..=256,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 1,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 2,
},
}
--> $DIR/thumb-enum.rs:24:1
|
LL | enum C { Chaenomeles = 256, }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(P) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
false,
),
valid_range: 268435456..=268435456,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
--> $DIR/thumb-enum.rs:28:1
|
LL | enum P { Peach = 0x1000_0000isize, }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: layout_of(T) = Layout {
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
fields: Arbitrary {
offsets: [
Size {
raw: 0,
},
],
memory_index: [
0,
],
},
variants: Multiple {
tag: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
fields: Arbitrary {
offsets: [],
memory_index: [],
},
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
},
],
},
abi: Scalar(
Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
),
largest_niche: Some(
Niche {
offset: Size {
raw: 0,
},
scalar: Scalar {
value: Int(
I32,
true,
),
valid_range: 2164260864..=2164260864,
},
},
),
align: AbiAndPrefAlign {
abi: Align {
pow2: 2,
},
pref: Align {
pow2: 2,
},
},
size: Size {
raw: 4,
},
}
--> $DIR/thumb-enum.rs:34:1
|
LL | enum T { Tangerine = TANGERINE as isize }

View File

@ -1,13 +1,13 @@
error: vtable entries for `<S as D>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
Method(<S as C>::foo_c),
TraitVPtr(<S as C>),
Method(<S as D>::foo_d),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
Method(<S as C>::foo_c),
TraitVPtr(<S as C>),
Method(<S as D>::foo_d),
]
--> $DIR/vtable-diamond.rs:21:1
|
LL | / trait D: B + C {
@ -17,12 +17,12 @@ LL | | }
| |_^
error: vtable entries for `<S as C>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as C>::foo_c),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as C>::foo_c),
]
--> $DIR/vtable-diamond.rs:15:1
|
LL | / trait C: A {

View File

@ -1,34 +1,34 @@
error: vtable entries for `<S as O>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
TraitVPtr(<S as B>),
Method(<S as C>::foo_c),
Method(<S as D>::foo_d),
TraitVPtr(<S as D>),
Method(<S as E>::foo_e),
TraitVPtr(<S as E>),
Method(<S as F>::foo_f),
TraitVPtr(<S as F>),
Method(<S as G>::foo_g),
Method(<S as H>::foo_h),
TraitVPtr(<S as H>),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
TraitVPtr(<S as J>),
Method(<S as K>::foo_k),
TraitVPtr(<S as K>),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
TraitVPtr(<S as M>),
Method(<S as N>::foo_n),
TraitVPtr(<S as N>),
Method(<S as O>::foo_o),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
TraitVPtr(<S as B>),
Method(<S as C>::foo_c),
Method(<S as D>::foo_d),
TraitVPtr(<S as D>),
Method(<S as E>::foo_e),
TraitVPtr(<S as E>),
Method(<S as F>::foo_f),
TraitVPtr(<S as F>),
Method(<S as G>::foo_g),
Method(<S as H>::foo_h),
TraitVPtr(<S as H>),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
TraitVPtr(<S as J>),
Method(<S as K>::foo_k),
TraitVPtr(<S as K>),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
TraitVPtr(<S as M>),
Method(<S as N>::foo_n),
TraitVPtr(<S as N>),
Method(<S as O>::foo_o),
]
--> $DIR/vtable-multi-level.rs:95:1
|
LL | / trait O: G + N {
@ -38,11 +38,11 @@ LL | | }
| |_^
error: vtable entries for `<S as B>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as B>::foo_b),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as B>::foo_b),
]
--> $DIR/vtable-multi-level.rs:19:1
|
LL | / trait B {
@ -52,11 +52,11 @@ LL | | }
| |_^
error: vtable entries for `<S as D>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as D>::foo_d),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as D>::foo_d),
]
--> $DIR/vtable-multi-level.rs:30:1
|
LL | / trait D {
@ -66,11 +66,11 @@ LL | | }
| |_^
error: vtable entries for `<S as E>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as E>::foo_e),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as E>::foo_e),
]
--> $DIR/vtable-multi-level.rs:36:1
|
LL | / trait E {
@ -80,14 +80,14 @@ LL | | }
| |_^
error: vtable entries for `<S as F>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as D>::foo_d),
Method(<S as E>::foo_e),
TraitVPtr(<S as E>),
Method(<S as F>::foo_f),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as D>::foo_d),
Method(<S as E>::foo_e),
TraitVPtr(<S as E>),
Method(<S as F>::foo_f),
]
--> $DIR/vtable-multi-level.rs:42:1
|
LL | / trait F: D + E {
@ -97,11 +97,11 @@ LL | | }
| |_^
error: vtable entries for `<S as H>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
]
--> $DIR/vtable-multi-level.rs:53:1
|
LL | / trait H {
@ -111,11 +111,11 @@ LL | | }
| |_^
error: vtable entries for `<S as I>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as I>::foo_i),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as I>::foo_i),
]
--> $DIR/vtable-multi-level.rs:59:1
|
LL | / trait I {
@ -125,14 +125,14 @@ LL | | }
| |_^
error: vtable entries for `<S as J>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
]
--> $DIR/vtable-multi-level.rs:65:1
|
LL | / trait J: H + I {
@ -142,11 +142,11 @@ LL | | }
| |_^
error: vtable entries for `<S as K>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as K>::foo_k),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as K>::foo_k),
]
--> $DIR/vtable-multi-level.rs:71:1
|
LL | / trait K {
@ -156,11 +156,11 @@ LL | | }
| |_^
error: vtable entries for `<S as L>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as L>::foo_l),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as L>::foo_l),
]
--> $DIR/vtable-multi-level.rs:77:1
|
LL | / trait L {
@ -170,14 +170,14 @@ LL | | }
| |_^
error: vtable entries for `<S as M>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as K>::foo_k),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as K>::foo_k),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
]
--> $DIR/vtable-multi-level.rs:83:1
|
LL | / trait M: K + L {
@ -187,21 +187,21 @@ LL | | }
| |_^
error: vtable entries for `<S as N>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
Method(<S as K>::foo_k),
TraitVPtr(<S as K>),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
TraitVPtr(<S as M>),
Method(<S as N>::foo_n),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as H>::foo_h),
Method(<S as I>::foo_i),
TraitVPtr(<S as I>),
Method(<S as J>::foo_j),
Method(<S as K>::foo_k),
TraitVPtr(<S as K>),
Method(<S as L>::foo_l),
TraitVPtr(<S as L>),
Method(<S as M>::foo_m),
TraitVPtr(<S as M>),
Method(<S as N>::foo_n),
]
--> $DIR/vtable-multi-level.rs:89:1
|
LL | / trait N: J + M {

View File

@ -1,12 +1,12 @@
error: vtable entries for `<S as C>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
TraitVPtr(<S as B>),
Method(<S as C>::foo_c),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a),
Method(<S as B>::foo_b),
TraitVPtr(<S as B>),
Method(<S as C>::foo_c),
]
--> $DIR/vtable-multiple.rs:16:1
|
LL | / trait C: A + B {
@ -16,11 +16,11 @@ LL | | }
| |_^
error: vtable entries for `<S as B>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as B>::foo_b),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as B>::foo_b),
]
--> $DIR/vtable-multiple.rs:10:1
|
LL | / trait B {

View File

@ -1,12 +1,12 @@
error: vtable entries for `<std::vec::IntoIter<u8> as A>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<std::vec::IntoIter<u8> as Iterator>::next),
Method(<std::vec::IntoIter<u8> as Iterator>::size_hint),
Method(<std::vec::IntoIter<u8> as Iterator>::advance_by),
Method(<std::vec::IntoIter<u8> as Iterator>::nth),
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<std::vec::IntoIter<u8> as Iterator>::next),
Method(<std::vec::IntoIter<u8> as Iterator>::size_hint),
Method(<std::vec::IntoIter<u8> as Iterator>::advance_by),
Method(<std::vec::IntoIter<u8> as Iterator>::nth),
]
--> $DIR/vtable-non-object-safe.rs:8:1
|
LL | trait A: Iterator {}

View File

@ -1,12 +1,12 @@
error: vtable entries for `<S as B>`: [
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a1),
Vacant,
Method(<S as B>::foo_b1),
Vacant,
]
MetadataDropInPlace,
MetadataSize,
MetadataAlign,
Method(<S as A>::foo_a1),
Vacant,
Method(<S as B>::foo_b1),
Vacant,
]
--> $DIR/vtable-vacant.rs:15:1
|
LL | / trait B: A {