summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-json/fns
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc-json/fns')
-rw-r--r--src/test/rustdoc-json/fns/pattern_arg.rs7
-rw-r--r--src/test/rustdoc-json/fns/return_type_alias.rs10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/rustdoc-json/fns/pattern_arg.rs b/src/test/rustdoc-json/fns/pattern_arg.rs
new file mode 100644
index 000000000..32b7da0fa
--- /dev/null
+++ b/src/test/rustdoc-json/fns/pattern_arg.rs
@@ -0,0 +1,7 @@
+// @is "$.index[*][?(@.name=='fst')].inner.decl.inputs[0][0]" '"(x, _)"'
+pub fn fst<X, Y>((x, _): (X, Y)) -> X {
+ x
+}
+
+// @is "$.index[*][?(@.name=='drop_int')].inner.decl.inputs[0][0]" '"_"'
+pub fn drop_int(_: i32) {}
diff --git a/src/test/rustdoc-json/fns/return_type_alias.rs b/src/test/rustdoc-json/fns/return_type_alias.rs
new file mode 100644
index 000000000..2578bb49a
--- /dev/null
+++ b/src/test/rustdoc-json/fns/return_type_alias.rs
@@ -0,0 +1,10 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/104851>
+
+/// @set foo = "$.index[*][?(@.name=='Foo')].id"
+pub type Foo = i32;
+
+// @is "$.index[*][?(@.name=='demo')].inner.decl.output.kind" '"resolved_path"'
+// @is "$.index[*][?(@.name=='demo')].inner.decl.output.inner.id" $foo
+pub fn demo() -> Foo {
+ 42
+}