about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-23 12:55:56 -0400
committerMichael Goulet <michael@errs.io>2024-09-23 12:55:56 -0400
commit9050b3374588fdb1b15a862a495b042dd64edd5a (patch)
tree90ea870bc0600ed49622a15ed54d421a279feda7
parentde66639bbcbff44eda26ef8ba7a79a4f82dc8a9a (diff)
downloadrust-9050b3374588fdb1b15a862a495b042dd64edd5a.tar.gz
rust-9050b3374588fdb1b15a862a495b042dd64edd5a.zip
Add a test
-rw-r--r--tests/ui/lint/lint-ctypes-non-recursion-limit.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-ctypes-non-recursion-limit.rs b/tests/ui/lint/lint-ctypes-non-recursion-limit.rs
new file mode 100644
index 00000000000..61e95dc5a46
--- /dev/null
+++ b/tests/ui/lint/lint-ctypes-non-recursion-limit.rs
@@ -0,0 +1,32 @@
+//@ check-pass
+
+#![recursion_limit = "5"]
+#![allow(unused)]
+#![deny(improper_ctypes)]
+
+#[repr(C)]
+struct F1(*const ());
+#[repr(C)]
+struct F2(*const ());
+#[repr(C)]
+struct F3(*const ());
+#[repr(C)]
+struct F4(*const ());
+#[repr(C)]
+struct F5(*const ());
+#[repr(C)]
+struct F6(*const ());
+
+#[repr(C)]
+struct B {
+    f1: F1,
+    f2: F2,
+    f3: F3,
+    f4: F4,
+    f5: F5,
+    f6: F6,
+}
+
+extern "C" fn foo(_: B) {}
+
+fn main() {}