]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-json/fns/qualifiers.rs
Rollup merge of #107687 - cjgillot:sroa-2, r=oli-obk
[rust.git] / tests / rustdoc-json / fns / qualifiers.rs
1 // edition:2018
2
3 // @is "$.index[*][?(@.name=='nothing_fn')].inner.header.async" false
4 // @is "$.index[*][?(@.name=='nothing_fn')].inner.header.const"  false
5 // @is "$.index[*][?(@.name=='nothing_fn')].inner.header.unsafe" false
6 pub fn nothing_fn() {}
7
8 // @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.async"  false
9 // @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.const"  false
10 // @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.unsafe" true
11 pub unsafe fn unsafe_fn() {}
12
13 // @is "$.index[*][?(@.name=='const_fn')].inner.header.async"  false
14 // @is "$.index[*][?(@.name=='const_fn')].inner.header.const"  true
15 // @is "$.index[*][?(@.name=='const_fn')].inner.header.unsafe" false
16 pub const fn const_fn() {}
17
18 // @is "$.index[*][?(@.name=='async_fn')].inner.header.async"  true
19 // @is "$.index[*][?(@.name=='async_fn')].inner.header.const"  false
20 // @is "$.index[*][?(@.name=='async_fn')].inner.header.unsafe" false
21 pub async fn async_fn() {}
22
23 // @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.async"  true
24 // @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.const"  false
25 // @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.unsafe" true
26 pub async unsafe fn async_unsafe_fn() {}
27
28 // @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.async"  false
29 // @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.const"  true
30 // @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.unsafe" true
31 pub const unsafe fn const_unsafe_fn() {}
32
33 // It's impossible for a function to be both const and async, so no test for that