]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-json/methods/header.rs
Rollup merge of #83456 - notriddle:vec-from-docs, r=JohnTitor
[rust.git] / src / test / rustdoc-json / methods / header.rs
1 // edition:2018
2
3 pub struct Foo;
4
5 impl Foo {
6     // @has header.json "$.index[*][?(@.name=='nothing_meth')].inner.header" "[]"
7     pub fn nothing_meth() {}
8
9     // @has - "$.index[*][?(@.name=='const_meth')].inner.header" '["const"]'
10     pub const fn const_meth() {}
11
12     // @has - "$.index[*][?(@.name=='async_meth')].inner.header" '["async"]'
13     pub async fn async_meth() {}
14
15     // @count - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" 2
16     // @has - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" '"async"'
17     // @has - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header[*]" '"unsafe"'
18     pub async unsafe fn async_unsafe_meth() {}
19
20     // @count - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" 2
21     // @has - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" '"const"'
22     // @has - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header[*]" '"unsafe"'
23     pub const unsafe fn const_unsafe_meth() {}
24
25     // It's impossible for a method to be both const and async, so no test for that
26 }