]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-json/fns/header.rs
Avoid possible filename collision in coverage tests
[rust.git] / src / test / rustdoc-json / fns / header.rs
1 // edition:2018
2
3 // @has header.json "$.index[*][?(@.name=='nothing_fn')].inner.header" "[]"
4 pub fn nothing_fn() {}
5
6 // @has - "$.index[*][?(@.name=='const_fn')].inner.header" '["const"]'
7 pub const fn const_fn() {}
8
9 // @has - "$.index[*][?(@.name=='async_fn')].inner.header" '["async"]'
10 pub async fn async_fn() {}
11
12 // @count - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" 2
13 // @has - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" '"async"'
14 // @has - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" '"unsafe"'
15 pub async unsafe fn async_unsafe_fn() {}
16
17 // @count - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" 2
18 // @has - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" '"const"'
19 // @has - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" '"unsafe"'
20 pub const unsafe fn const_unsafe_fn() {}
21
22 // It's impossible for a function to be both const and async, so no test for that