Skip to content

Commit c7875a0

Browse files
committed
assert that #[rustc_pass_indirectly_in_non_rustic_abis] is respected
1 parent 77d7b4c commit c7875a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/src/ffi/va_list.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,15 @@ impl<'f> Drop for VaListImpl<'f> {
299299
// This works for now, since `va_end` is a no-op on all current LLVM targets.
300300
}
301301
}
302+
303+
// Checks (via an assert in `compiler/rustc_ty_utils/src/abi.rs`) that the C ABI for the current
304+
// target correctly implements `rustc_pass_indirectly_in_non_rustic_abis`.
305+
const _: () = {
306+
#[repr(C)]
307+
#[rustc_pass_indirectly_in_non_rustic_abis]
308+
struct Type(usize);
309+
310+
const extern "C" fn c(_: Type) {}
311+
312+
c(Type(0))
313+
};

0 commit comments

Comments
 (0)