]>
Commit | Line | Data |
---|---|---|
5e7ed085 FG |
1 | // edition:2018 |
2 | ||
3 | pub struct Foo; | |
4 | ||
5 | impl Foo { | |
f2b60f7d FG |
6 | // @is "$.index[*][?(@.name=='const_meth')].inner.header.async" false |
7 | // @is "$.index[*][?(@.name=='const_meth')].inner.header.const" true | |
8 | // @is "$.index[*][?(@.name=='const_meth')].inner.header.unsafe" false | |
5e7ed085 FG |
9 | pub const fn const_meth() {} |
10 | ||
f2b60f7d FG |
11 | // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.async" false |
12 | // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.const" false | |
13 | // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.unsafe" false | |
5e7ed085 FG |
14 | pub fn nothing_meth() {} |
15 | ||
f2b60f7d FG |
16 | // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.async" false |
17 | // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.const" false | |
18 | // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.unsafe" true | |
5e7ed085 FG |
19 | pub unsafe fn unsafe_meth() {} |
20 | ||
f2b60f7d FG |
21 | // @is "$.index[*][?(@.name=='async_meth')].inner.header.async" true |
22 | // @is "$.index[*][?(@.name=='async_meth')].inner.header.const" false | |
23 | // @is "$.index[*][?(@.name=='async_meth')].inner.header.unsafe" false | |
5e7ed085 FG |
24 | pub async fn async_meth() {} |
25 | ||
f2b60f7d FG |
26 | // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.async" true |
27 | // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.const" false | |
28 | // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.unsafe" true | |
5e7ed085 FG |
29 | pub async unsafe fn async_unsafe_meth() {} |
30 | ||
f2b60f7d FG |
31 | // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.async" false |
32 | // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.const" true | |
33 | // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.unsafe" true | |
5e7ed085 FG |
34 | pub const unsafe fn const_unsafe_meth() {} |
35 | ||
36 | // It's impossible for a method to be both const and async, so no test for that | |
37 | } |