2023-08-30 02:57:48 -05:00
|
|
|
error: fn_abi_of(test) = FnAbi {
|
2023-08-25 16:01:06 -05:00
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u8,
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(1 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=255,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: bool,
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(1 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=1,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: Some(
|
|
|
|
Niche {
|
|
|
|
offset: Size(0 bytes),
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=1,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: Zext,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:15:1
|
2023-08-25 16:01:06 -05:00
|
|
|
|
|
|
|
|
LL | fn test(_x: u8) -> bool { true }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-08-30 02:57:48 -05:00
|
|
|
error: fn_abi_of(TestFnPtr) = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: bool,
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(1 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=1,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: Some(
|
|
|
|
Niche {
|
|
|
|
offset: Size(0 bytes),
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=1,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: Zext,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u8,
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(1 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=255,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:18:1
|
2023-08-30 02:57:48 -05:00
|
|
|
|
|
|
|
|
LL | type TestFnPtr = fn(bool) -> u8;
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: fn_abi_of(test_generic) = FnAbi {
|
2023-08-25 16:01:06 -05:00
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
2023-01-23 10:02:00 -06:00
|
|
|
ty: *const T,
|
2023-08-25 16:01:06 -05:00
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Pointer(
|
|
|
|
AddressSpace(
|
|
|
|
0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:21:1
|
2023-08-25 16:01:06 -05:00
|
|
|
|
|
|
|
|
LL | fn test_generic<T>(_x: *const T) { }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-02 07:03:25 -05:00
|
|
|
error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:24:1
|
2023-09-02 07:03:25 -05:00
|
|
|
|
|
|
|
|
LL | const C: () = ();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2023-09-06 04:13:20 -05:00
|
|
|
error: ABIs are not compatible
|
|
|
|
left ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u8,
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(1 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I8,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: 0..=255,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
|
|
|
right ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u32,
|
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I32,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:40:1
|
2023-09-06 04:13:20 -05:00
|
|
|
|
|
|
|
|
LL | type TestAbiNe = (fn(u8), fn(u32));
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-05 02:20:40 -05:00
|
|
|
error: ABIs are not compatible
|
|
|
|
left ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
2023-01-23 10:02:00 -06:00
|
|
|
ty: [u8; 32],
|
2023-09-05 02:20:40 -05:00
|
|
|
layout: Layout {
|
|
|
|
size: Size(32 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Array {
|
|
|
|
stride: Size(1 bytes),
|
|
|
|
count: 32,
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Indirect {
|
|
|
|
attrs: ArgAttributes {
|
|
|
|
regular: NoAlias | NoCapture | NonNull | NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(32 bytes),
|
|
|
|
pointee_align: Some(
|
|
|
|
Align(1 bytes),
|
|
|
|
),
|
|
|
|
},
|
2023-09-08 01:48:41 -05:00
|
|
|
meta_attrs: None,
|
2023-09-05 02:20:40 -05:00
|
|
|
on_stack: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
|
|
|
right ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
2023-01-23 10:02:00 -06:00
|
|
|
ty: [u32; 32],
|
2023-09-05 02:20:40 -05:00
|
|
|
layout: Layout {
|
|
|
|
size: Size(128 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Array {
|
|
|
|
stride: Size(4 bytes),
|
|
|
|
count: 32,
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Indirect {
|
|
|
|
attrs: ArgAttributes {
|
|
|
|
regular: NoAlias | NoCapture | NonNull | NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(128 bytes),
|
|
|
|
pointee_align: Some(
|
|
|
|
Align(4 bytes),
|
|
|
|
),
|
|
|
|
},
|
2023-09-08 01:48:41 -05:00
|
|
|
meta_attrs: None,
|
2023-09-05 02:20:40 -05:00
|
|
|
on_stack: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:43:1
|
2023-09-05 02:20:40 -05:00
|
|
|
|
|
|
|
|
LL | type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32]));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-02 04:59:31 -05:00
|
|
|
error: ABIs are not compatible
|
|
|
|
left ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: f32,
|
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
2024-05-06 07:27:40 -05:00
|
|
|
value: Float(
|
|
|
|
F32,
|
|
|
|
),
|
2023-09-02 04:59:31 -05:00
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
|
|
|
right ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u32,
|
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I32,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:46:1
|
2023-09-02 04:59:31 -05:00
|
|
|
|
|
|
|
|
LL | type TestAbiNeFloat = (fn(f32), fn(u32));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: ABIs are not compatible
|
|
|
|
left ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: i32,
|
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I32,
|
|
|
|
true,
|
|
|
|
),
|
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
|
|
|
right ABI = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: u32,
|
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Int(
|
|
|
|
I32,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
valid_range: $FULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(0 bytes),
|
|
|
|
pointee_align: None,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:50:1
|
2023-09-02 04:59:31 -05:00
|
|
|
|
|
|
|
|
LL | type TestAbiNeSign = (fn(i32), fn(u32));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-09 09:52:20 -05:00
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:53:46
|
2023-09-09 09:52:20 -05:00
|
|
|
|
|
|
|
|
LL | type TestAbiEqNonsense = (fn((str, str)), fn((str, str)));
|
2023-09-09 10:43:20 -05:00
|
|
|
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
2023-09-09 09:52:20 -05:00
|
|
|
|
|
|
|
|
= help: the trait `Sized` is not implemented for `str`
|
|
|
|
= note: only the last element of a tuple may have a dynamically sized type
|
|
|
|
|
2023-09-09 10:39:53 -05:00
|
|
|
error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:28:5
|
2023-09-09 10:39:53 -05:00
|
|
|
|
|
|
|
|
LL | const C: () = ();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: fn_abi_of(assoc_test) = FnAbi {
|
|
|
|
args: [
|
|
|
|
ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
2023-01-23 10:02:00 -06:00
|
|
|
ty: &S,
|
2023-09-09 10:39:53 -05:00
|
|
|
layout: Layout {
|
|
|
|
size: $SOME_SIZE,
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Scalar(
|
|
|
|
Initialized {
|
|
|
|
value: Pointer(
|
|
|
|
AddressSpace(
|
|
|
|
0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
valid_range: $NON_NULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
fields: Primitive,
|
|
|
|
largest_niche: Some(
|
|
|
|
Niche {
|
|
|
|
offset: Size(0 bytes),
|
|
|
|
value: Pointer(
|
|
|
|
AddressSpace(
|
|
|
|
0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
valid_range: $NON_NULL,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Direct(
|
|
|
|
ArgAttributes {
|
|
|
|
regular: NoAlias | NonNull | ReadOnly | NoUndef,
|
|
|
|
arg_ext: None,
|
|
|
|
pointee_size: Size(2 bytes),
|
|
|
|
pointee_align: Some(
|
|
|
|
Align(2 bytes),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ret: ArgAbi {
|
|
|
|
layout: TyAndLayout {
|
|
|
|
ty: (),
|
|
|
|
layout: Layout {
|
|
|
|
size: Size(0 bytes),
|
|
|
|
align: AbiAndPrefAlign {
|
|
|
|
abi: $SOME_ALIGN,
|
|
|
|
pref: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
abi: Aggregate {
|
|
|
|
sized: true,
|
|
|
|
},
|
|
|
|
fields: Arbitrary {
|
|
|
|
offsets: [],
|
|
|
|
memory_index: [],
|
|
|
|
},
|
|
|
|
largest_niche: None,
|
|
|
|
variants: Single {
|
|
|
|
index: 0,
|
|
|
|
},
|
|
|
|
max_repr_align: None,
|
|
|
|
unadjusted_abi_align: $SOME_ALIGN,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mode: Ignore,
|
|
|
|
},
|
|
|
|
c_variadic: false,
|
|
|
|
fixed_count: 1,
|
|
|
|
conv: Rust,
|
|
|
|
can_unwind: $SOME_BOOL,
|
|
|
|
}
|
2023-01-23 10:02:00 -06:00
|
|
|
--> $DIR/debug.rs:33:5
|
2023-09-09 10:39:53 -05:00
|
|
|
|
|
|
|
|
LL | fn assoc_test(&self) { }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-09-09 09:52:20 -05:00
|
|
|
error: aborting due to 11 previous errors
|
2023-08-25 16:01:06 -05:00
|
|
|
|
2023-09-09 09:52:20 -05:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|