summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json/type/fn_lifetime.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/rustdoc-json/type/fn_lifetime.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json/type/fn_lifetime.rs')
-rw-r--r--tests/rustdoc-json/type/fn_lifetime.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/rustdoc-json/type/fn_lifetime.rs b/tests/rustdoc-json/type/fn_lifetime.rs
new file mode 100644
index 000000000..d7216ec76
--- /dev/null
+++ b/tests/rustdoc-json/type/fn_lifetime.rs
@@ -0,0 +1,27 @@
+// ignore-tidy-linelength
+
+// @is "$.index[*][?(@.name=='GenericFn')].kind" \"typedef\"
+
+// @ismany "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].name" \"\'a\"
+// @has "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime"
+// @count "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime.outlives[*]" 0
+// @count "$.index[*][?(@.name=='GenericFn')].inner.generics.where_predicates[*]" 0
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.kind" \"function_pointer\"
+// @count "$.index[*][?(@.name=='GenericFn')].inner.type.inner.generic_params[*]" 0
+// @count "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
+
+pub type GenericFn<'a> = fn(&'a i32) -> &'a i32;
+
+// @is "$.index[*][?(@.name=='ForAll')].kind" \"typedef\"
+// @count "$.index[*][?(@.name=='ForAll')].inner.generics.params[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.generics.where_predicates[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*]" 1
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].name" \"\'a\"
+// @has "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime"
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime.outlives[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
+pub type ForAll = for<'a> fn(&'a i32) -> &'a i32;