summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-28983.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-28983.rs')
-rw-r--r--tests/ui/issues/issue-28983.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-28983.rs b/tests/ui/issues/issue-28983.rs
new file mode 100644
index 000000000..3db26a1ee
--- /dev/null
+++ b/tests/ui/issues/issue-28983.rs
@@ -0,0 +1,22 @@
+// run-pass
+pub trait Test { type T; }
+
+impl Test for u32 {
+ type T = i32;
+}
+
+pub mod export {
+ #[no_mangle]
+ pub extern "C" fn issue_28983(t: <u32 as ::Test>::T) -> i32 { t*3 }
+}
+
+// to test both exporting and importing functions, import
+// a function from ourselves.
+extern "C" {
+ fn issue_28983(t: <u32 as Test>::T) -> i32;
+}
+
+fn main() {
+ assert_eq!(export::issue_28983(2), 6);
+ assert_eq!(unsafe { issue_28983(3) }, 9);
+}