about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-26 21:58:39 -0700
committerGitHub <noreply@github.com>2024-10-26 21:58:39 -0700
commit05f784c9550d1f624da48fcfd1b32179cb2240b4 (patch)
tree300f1ac1cee63edcadd58a6eff94ff275d53254e /tests
parentf7cf41c97350f972d7281c20ed2d0c3744329023 (diff)
parent09773b4f24841c5ff3b2ba035e3b9772a58f6178 (diff)
downloadrust-05f784c9550d1f624da48fcfd1b32179cb2240b4.tar.gz
rust-05f784c9550d1f624da48fcfd1b32179cb2240b4.zip
Rollup merge of #132123 - lolbinarycat:rustdoc-search-foreign-func, r=notriddle
allow type-based search on foreign functions

fixes https://github.com/rust-lang/rust/issues/131804

preferably will be merged after #129708, but that may take a while to be approved due to being a new feature, whereas this is definitely a bug, and should be fixed.
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc-js/extern-func.js8
-rw-r--r--tests/rustdoc-js/extern-func.rs5
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/rustdoc-js/extern-func.js b/tests/rustdoc-js/extern-func.js
new file mode 100644
index 00000000000..a3fe2d8ea42
--- /dev/null
+++ b/tests/rustdoc-js/extern-func.js
@@ -0,0 +1,8 @@
+const EXPECTED = [
+    {
+        'query': 'c_float -> c_float',
+        'others': [
+            { 'path': 'extern_func', 'name': 'sqrt' }
+        ],
+    },
+];
diff --git a/tests/rustdoc-js/extern-func.rs b/tests/rustdoc-js/extern-func.rs
new file mode 100644
index 00000000000..ab1e3e75da7
--- /dev/null
+++ b/tests/rustdoc-js/extern-func.rs
@@ -0,0 +1,5 @@
+use std::ffi::c_float;
+
+extern "C" {
+    pub fn sqrt(x: c_float) -> c_float;
+}