about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-06-20 10:05:16 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-06-20 10:05:23 +0000
commitaebbeceb88ccfa2ebf80a1c0dc97838b79406387 (patch)
tree6bdae4f7bc304cba0f63a8e4e57a3c2a841a621c /example
parentdaf79b56859c3b446f7f2db09f3b4a6d21883ff2 (diff)
downloadrust-aebbeceb88ccfa2ebf80a1c0dc97838b79406387.tar.gz
rust-aebbeceb88ccfa2ebf80a1c0dc97838b79406387.zip
Handle rust-call abi without self argument
Fixes #1236
Diffstat (limited to 'example')
-rw-r--r--example/std_example.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/example/std_example.rs b/example/std_example.rs
index b762bba70eb..490cc2404f6 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -1,4 +1,12 @@
-#![feature(core_intrinsics, generators, generator_trait, is_sorted, repr_simd)]
+#![feature(
+    core_intrinsics,
+    generators,
+    generator_trait,
+    is_sorted,
+    repr_simd,
+    tuple_trait,
+    unboxed_closures
+)]
 
 #[cfg(target_arch = "x86_64")]
 use std::arch::x86_64::*;
@@ -157,6 +165,8 @@ fn main() {
     foo(I64X2(0, 0));
 
     transmute_fat_pointer();
+
+    rust_call_abi();
 }
 
 fn panic(_: u128) {
@@ -174,6 +184,13 @@ fn transmute_fat_pointer() -> TwoPtrs {
     unsafe { transmute::<_, TwoPtrs>("true !") }
 }
 
+extern "rust-call" fn rust_call_abi_callee<T: std::marker::Tuple>(_: T) {}
+
+fn rust_call_abi() {
+    rust_call_abi_callee(());
+    rust_call_abi_callee((1, 2));
+}
+
 #[repr(simd)]
 struct I64X2(i64, i64);