about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/field-is-unary-func.js
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-01-13 15:31:15 -0600
committerbinarycat <binarycat@envs.net>2025-01-16 11:52:00 -0600
commit9397d133f683070863029552313b5e083398bf42 (patch)
tree51632cf584458936608639cfb0efc67f2d3c09e0 /tests/rustdoc-js-std/field-is-unary-func.js
parentd8a64098c9d0fb25699f657c6efff0bb418f7e18 (diff)
downloadrust-9397d133f683070863029552313b5e083398bf42.tar.gz
rust-9397d133f683070863029552313b5e083398bf42.zip
Treat other items as functions for the purpose of type-based search
constants and statics are nullary functions, and struct fields are unary functions.

functions (along with methods and trait methods) are prioritized over other
items, like fields and constants.
Diffstat (limited to 'tests/rustdoc-js-std/field-is-unary-func.js')
-rw-r--r--tests/rustdoc-js-std/field-is-unary-func.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/rustdoc-js-std/field-is-unary-func.js b/tests/rustdoc-js-std/field-is-unary-func.js
new file mode 100644
index 00000000000..09ce8a0dde0
--- /dev/null
+++ b/tests/rustdoc-js-std/field-is-unary-func.js
@@ -0,0 +1,7 @@
+const EXPECTED = {
+    // one of the only non-generic structs with public fields
+    'query': 'CpuidResult -> u32',
+    'others': [
+        { 'path': 'core::arch::x86::CpuidResult', 'name': 'eax' },
+    ],
+}