From 65e616d1966324174dafce3c697de1ad2c6b0cfe Mon Sep 17 00:00:00 2001 From: YingkaiLi-VM Date: Wed, 4 Jun 2025 01:29:13 +0800 Subject: [PATCH 1/4] Fixed the ABI parameter inconsistency issue in debug.rs for the riscv64 architecture. --- tests/ui/abi/debug.generic.stderr | 1015 +++++++++++++++++++++++++++++ tests/ui/abi/debug.riscv64.stderr | 1015 +++++++++++++++++++++++++++++ tests/ui/abi/debug.rs | 3 + 3 files changed, 2033 insertions(+) create mode 100644 tests/ui/abi/debug.generic.stderr create mode 100644 tests/ui/abi/debug.riscv64.stderr diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr new file mode 100644 index 0000000000000..fc78695cafc02 --- /dev/null +++ b/tests/ui/abi/debug.generic.stderr @@ -0,0 +1,1015 @@ +error: fn_abi_of(test) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + } + --> $DIR/debug.rs:19:1 + | +LL | fn test(_x: u8) -> bool { true } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + } + --> $DIR/debug.rs:22:1 + | +LL | type TestFnPtr = fn(bool) -> u8; + | ^^^^^^^^^^^^^^ + +error: fn_abi_of(test_generic) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: *const T, + layout: Layout { + size: $SOME_SIZE, + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Scalar( + Initialized { + value: Pointer( + AddressSpace( + 0, + ), + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:25:1 + | +LL | fn test_generic(_x: *const T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions + --> $DIR/debug.rs:28:1 + | +LL | const C: () = (); + | ^^^^^^^^^^^ + +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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:44:1 + | +LL | type TestAbiNe = (fn(u8), fn(u32)); + | ^^^^^^^^^^^^^^ + +error: ABIs are not compatible + left ABI = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: [u8; 32], + layout: Layout { + size: Size(32 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 32, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(32 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + right ABI = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: [u32; 32], + layout: Layout { + size: Size(128 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(4 bytes), + count: 32, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(128 bytes), + pointee_align: Some( + Align(4 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:47:1 + | +LL | type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32])); + | ^^^^^^^^^^^^^^^^^^^^ + +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, + }, + backend_repr: Scalar( + Initialized { + value: Float( + F32, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:50:1 + | +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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:54:1 + | +LL | type TestAbiNeSign = (fn(i32), fn(u32)); + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/debug.rs:57:46 + | +LL | type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); + | ^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: only the last element of a tuple may have a dynamically sized type + +error: unrecognized argument + --> $DIR/debug.rs:59:13 + | +LL | #[rustc_abi("assert_eq")] + | ^^^^^^^^^^^ + +error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions + --> $DIR/debug.rs:32:5 + | +LL | const C: () = (); + | ^^^^^^^^^^^ + +error: fn_abi_of(assoc_test) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: &S, + layout: Layout { + size: $SOME_SIZE, + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:37:5 + | +LL | fn assoc_test(&self) { } + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr new file mode 100644 index 0000000000000..a62b4c7f99dfc --- /dev/null +++ b/tests/ui/abi/debug.riscv64.stderr @@ -0,0 +1,1015 @@ +error: fn_abi_of(test) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: u8, + layout: Layout { + size: Size(1 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + 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, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + } + --> $DIR/debug.rs:19:1 + | +LL | fn test(_x: u8) -> bool { true } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + } + --> $DIR/debug.rs:22:1 + | +LL | type TestFnPtr = fn(bool) -> u8; + | ^^^^^^^^^^^^^^ + +error: fn_abi_of(test_generic) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: *const T, + layout: Layout { + size: $SOME_SIZE, + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Scalar( + Initialized { + value: Pointer( + AddressSpace( + 0, + ), + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:25:1 + | +LL | fn test_generic(_x: *const T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions + --> $DIR/debug.rs:28:1 + | +LL | const C: () = (); + | ^^^^^^^^^^^ + +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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I8, + false, + ), + valid_range: 0..=255, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Zext, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:44:1 + | +LL | type TestAbiNe = (fn(u8), fn(u32)); + | ^^^^^^^^^^^^^^ + +error: ABIs are not compatible + left ABI = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: [u8; 32], + layout: Layout { + size: Size(32 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 32, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(32 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + right ABI = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: [u32; 32], + layout: Layout { + size: Size(128 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(4 bytes), + count: 32, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(128 bytes), + pointee_align: Some( + Align(4 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:47:1 + | +LL | type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32])); + | ^^^^^^^^^^^^^^^^^^^^ + +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, + }, + backend_repr: Scalar( + Initialized { + value: Float( + F32, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:50:1 + | +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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + true, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Scalar( + Initialized { + value: Int( + I32, + false, + ), + valid_range: $FULL, + }, + ), + fields: Primitive, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Direct( + ArgAttributes { + regular: NoUndef, + arg_ext: Sext, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:54:1 + | +LL | type TestAbiNeSign = (fn(i32), fn(u32)); + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/debug.rs:57:46 + | +LL | type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); + | ^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: only the last element of a tuple may have a dynamically sized type + +error: unrecognized argument + --> $DIR/debug.rs:59:13 + | +LL | #[rustc_abi("assert_eq")] + | ^^^^^^^^^^^ + +error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions + --> $DIR/debug.rs:32:5 + | +LL | const C: () = (); + | ^^^^^^^^^^^ + +error: fn_abi_of(assoc_test) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: &S, + layout: Layout { + size: $SOME_SIZE, + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + backend_repr: 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, + }, + ), + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + 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, + }, + backend_repr: Memory { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + randomization_seed: $SEED, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: Rust, + can_unwind: $SOME_BOOL, + } + --> $DIR/debug.rs:37:5 + | +LL | fn assoc_test(&self) { } + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/abi/debug.rs b/tests/ui/abi/debug.rs index c0d8de05fda5e..5355e1cd14779 100644 --- a/tests/ui/abi/debug.rs +++ b/tests/ui/abi/debug.rs @@ -7,6 +7,9 @@ //@ normalize-stderr: "(valid_range): [1-9]\.\.=(429496729[0-9]|1844674407370955161[0-9])" -> "$1: $$NON_NULL" // Some attributes are only computed for release builds: //@ compile-flags: -O +//@ revisions: generic riscv64 +//@ [riscv64] only-riscv64 +//@ [generic] ignore-riscv64 #![feature(rustc_attrs)] #![crate_type = "lib"] From 2a0177573f198d380b981580646f85b28fa5102c Mon Sep 17 00:00:00 2001 From: YingkaiLi-VM Date: Thu, 5 Jun 2025 19:27:52 +0800 Subject: [PATCH 2/4] Delete tests/ui/abi/debug.stderr --- tests/ui/abi/debug.stderr | 991 -------------------------------------- 1 file changed, 991 deletions(-) delete mode 100644 tests/ui/abi/debug.stderr diff --git a/tests/ui/abi/debug.stderr b/tests/ui/abi/debug.stderr deleted file mode 100644 index 8ed6dedf4d5a1..0000000000000 --- a/tests/ui/abi/debug.stderr +++ /dev/null @@ -1,991 +0,0 @@ -error: fn_abi_of(test) = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: u8, - layout: Layout { - size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I8, - false, - ), - valid_range: 0..=255, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: 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, - }, - ), - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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, - } - --> $DIR/debug.rs:16:1 - | -LL | fn test(_x: u8) -> bool { true } - | ^^^^^^^^^^^^^^^^^^^^^^^ - -error: fn_abi_of(TestFnPtr) = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: bool, - layout: Layout { - size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: 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, - }, - ), - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I8, - false, - ), - valid_range: 0..=255, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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, - } - --> $DIR/debug.rs:19:1 - | -LL | type TestFnPtr = fn(bool) -> u8; - | ^^^^^^^^^^^^^^ - -error: fn_abi_of(test_generic) = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: *const T, - layout: Layout { - size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Pointer( - AddressSpace( - 0, - ), - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:22:1 - | -LL | fn test_generic(_x: *const T) { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions - --> $DIR/debug.rs:25:1 - | -LL | const C: () = (); - | ^^^^^^^^^^^ - -error: ABIs are not compatible - left ABI = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: u8, - layout: Layout { - size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I8, - false, - ), - valid_range: 0..=255, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I32, - false, - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:41:1 - | -LL | type TestAbiNe = (fn(u8), fn(u32)); - | ^^^^^^^^^^^^^^ - -error: ABIs are not compatible - left ABI = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: [u8; 32], - layout: Layout { - size: Size(32 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Array { - stride: Size(1 bytes), - count: 32, - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Indirect { - attrs: ArgAttributes { - regular: NoAlias | NoCapture | NonNull | NoUndef, - arg_ext: None, - pointee_size: Size(32 bytes), - pointee_align: Some( - Align(1 bytes), - ), - }, - meta_attrs: None, - on_stack: false, - }, - }, - ], - ret: ArgAbi { - layout: TyAndLayout { - ty: (), - layout: Layout { - size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - right ABI = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: [u32; 32], - layout: Layout { - size: Size(128 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Array { - stride: Size(4 bytes), - count: 32, - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Indirect { - attrs: ArgAttributes { - regular: NoAlias | NoCapture | NonNull | NoUndef, - arg_ext: None, - pointee_size: Size(128 bytes), - pointee_align: Some( - Align(4 bytes), - ), - }, - meta_attrs: None, - on_stack: false, - }, - }, - ], - ret: ArgAbi { - layout: TyAndLayout { - ty: (), - layout: Layout { - size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:44:1 - | -LL | type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32])); - | ^^^^^^^^^^^^^^^^^^^^ - -error: ABIs are not compatible - left ABI = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: f32, - layout: Layout { - size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Float( - F32, - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I32, - false, - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:47:1 - | -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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I32, - true, - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Scalar( - Initialized { - value: Int( - I32, - false, - ), - valid_range: $FULL, - }, - ), - fields: Primitive, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:51:1 - | -LL | type TestAbiNeSign = (fn(i32), fn(u32)); - | ^^^^^^^^^^^^^^^^^^ - -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/debug.rs:54:46 - | -LL | type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); - | ^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - = note: only the last element of a tuple may have a dynamically sized type - -error: unrecognized argument - --> $DIR/debug.rs:56:13 - | -LL | #[rustc_abi("assert_eq")] - | ^^^^^^^^^^^ - -error: `#[rustc_abi]` can only be applied to function items, type aliases, and associated functions - --> $DIR/debug.rs:29:5 - | -LL | const C: () = (); - | ^^^^^^^^^^^ - -error: fn_abi_of(assoc_test) = FnAbi { - args: [ - ArgAbi { - layout: TyAndLayout { - ty: &S, - layout: Layout { - size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: 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, - }, - ), - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - 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: AbiAlign { - abi: $SOME_ALIGN, - }, - backend_repr: Memory { - sized: true, - }, - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - largest_niche: None, - uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: $SOME_ALIGN, - randomization_seed: $SEED, - }, - }, - mode: Ignore, - }, - c_variadic: false, - fixed_count: 1, - conv: Rust, - can_unwind: $SOME_BOOL, - } - --> $DIR/debug.rs:34:5 - | -LL | fn assoc_test(&self) { } - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 12 previous errors - -For more information about this error, try `rustc --explain E0277`. From 401997c8eef758a13a2328d7f3ccb54e2c618d17 Mon Sep 17 00:00:00 2001 From: YingkaiLi-VM Date: Wed, 11 Jun 2025 14:27:56 +0800 Subject: [PATCH 3/4] Fix conflict in debug.riscv64.stderr file --- tests/ui/abi/debug.riscv64.stderr | 72 +++++++++++-------------------- 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index a62b4c7f99dfc..e5f7af7d58478 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -5,9 +5,8 @@ error: fn_abi_of(test) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -44,9 +43,8 @@ error: fn_abi_of(test) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -103,9 +101,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -151,9 +148,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -201,9 +197,8 @@ error: fn_abi_of(test_generic) = FnAbi { ty: *const T, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -241,9 +236,8 @@ error: fn_abi_of(test_generic) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -288,9 +282,8 @@ error: ABIs are not compatible ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -327,9 +320,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -362,9 +354,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -401,9 +392,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -442,9 +432,8 @@ error: ABIs are not compatible ty: [u8; 32], layout: Layout { size: Size(32 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -482,9 +471,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -517,9 +505,8 @@ error: ABIs are not compatible ty: [u32; 32], layout: Layout { size: Size(128 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -557,9 +544,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -598,9 +584,8 @@ error: ABIs are not compatible ty: f32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -636,9 +621,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -671,9 +655,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -710,9 +693,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -751,9 +733,8 @@ error: ABIs are not compatible ty: i32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -790,9 +771,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -825,9 +805,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -864,9 +843,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -925,9 +903,8 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: &S, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -977,9 +954,8 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, From 3a036a1f9c7612d37f05243b4ce1f238f921864a Mon Sep 17 00:00:00 2001 From: YingkaiLi-VM Date: Wed, 11 Jun 2025 14:53:03 +0800 Subject: [PATCH 4/4] Fix conflict in debug.generic.stderr file --- tests/ui/abi/debug.generic.stderr | 72 +++++++++++-------------------- 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index fc78695cafc02..68df57e56acb2 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -5,9 +5,8 @@ error: fn_abi_of(test) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -44,9 +43,8 @@ error: fn_abi_of(test) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -103,9 +101,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -151,9 +148,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -201,9 +197,8 @@ error: fn_abi_of(test_generic) = FnAbi { ty: *const T, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -241,9 +236,8 @@ error: fn_abi_of(test_generic) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -288,9 +282,8 @@ error: ABIs are not compatible ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -327,9 +320,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -362,9 +354,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -401,9 +392,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -442,9 +432,8 @@ error: ABIs are not compatible ty: [u8; 32], layout: Layout { size: Size(32 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -482,9 +471,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -517,9 +505,8 @@ error: ABIs are not compatible ty: [u32; 32], layout: Layout { size: Size(128 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -557,9 +544,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -598,9 +584,8 @@ error: ABIs are not compatible ty: f32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -636,9 +621,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -671,9 +655,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -710,9 +693,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -751,9 +733,8 @@ error: ABIs are not compatible ty: i32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -790,9 +771,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -825,9 +805,8 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -864,9 +843,8 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true, @@ -925,9 +903,8 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: &S, layout: Layout { size: $SOME_SIZE, - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Scalar( Initialized { @@ -977,9 +954,8 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAndPrefAlign { + align: AbiAlign { abi: $SOME_ALIGN, - pref: $SOME_ALIGN, }, backend_repr: Memory { sized: true,