about summary refs log tree commit diff
path: root/src/test/rustdoc-json/methods
diff options
context:
space:
mode:
authorRune Tynan <runetynan@gmail.com>2021-02-08 13:48:10 -0500
committerRune Tynan <runetynan@gmail.com>2021-02-08 14:00:30 -0500
commita26fa74d3cba37a6e1df2dffae00c522546350a3 (patch)
tree44e3e3f749b8cf84eaf1abdd3809bd10a7be2db6 /src/test/rustdoc-json/methods
parent36ecbc94eb6be90bc38b2d0fdd4bfac3f34d9923 (diff)
downloadrust-a26fa74d3cba37a6e1df2dffae00c522546350a3.tar.gz
rust-a26fa74d3cba37a6e1df2dffae00c522546350a3.zip
Make `header` a vec of modifiers, make FunctionPointer consistent with Function and Method.
Diffstat (limited to 'src/test/rustdoc-json/methods')
-rw-r--r--src/test/rustdoc-json/methods/header.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/rustdoc-json/methods/header.rs b/src/test/rustdoc-json/methods/header.rs
new file mode 100644
index 00000000000..27a6ec04730
--- /dev/null
+++ b/src/test/rustdoc-json/methods/header.rs
@@ -0,0 +1,24 @@
+// edition:2018
+
+pub struct Foo;
+
+impl Foo {
+    // @has header.json "$.index[*][?(@.name=='nothing_meth')].inner.header" "[]"
+    pub fn nothing_meth() {}
+
+    // @has - "$.index[*][?(@.name=='const_meth')].inner.header" '["const"]'
+    pub const fn const_meth() {}
+
+    // @has - "$.index[*][?(@.name=='async_meth')].inner.header" '["async"]'
+    pub async fn async_meth() {}
+
+    // @count - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" 2
+    // @has - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" '"async"'
+    // @has - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" '"unsafe"'
+    pub async unsafe fn async_unsafe_meth() {}
+
+    // @count - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" 2
+    // @has - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" '"const"'
+    // @has - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" '"unsafe"'
+    pub const unsafe fn const_unsafe_meth() {}
+}