Make header a vec of modifiers, make FunctionPointer consistent with Function and Method.

This commit is contained in:
Rune Tynan 2021-02-08 13:48:10 -05:00
parent 36ecbc94eb
commit a26fa74d3c
No known key found for this signature in database
GPG key ID: 7ECC932F8B2C731E
7 changed files with 85 additions and 16 deletions

View file

@ -0,0 +1,5 @@
// @has header.json "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header" "[]"
pub type FnPointer = fn();
// @has - "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header" '["unsafe"]'
pub type UnsafePointer = unsafe fn();

View file

@ -0,0 +1,20 @@
// edition:2018
// @has header.json "$.index[*][?(@.name=='nothing_fn')].inner.header" "[]"
pub fn nothing_fn() {}
// @has - "$.index[*][?(@.name=='const_fn')].inner.header" '["const"]'
pub const fn const_fn() {}
// @has - "$.index[*][?(@.name=='async_fn')].inner.header" '["async"]'
pub async fn async_fn() {}
// @count - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" 2
// @has - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" '"async"'
// @has - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header[*]" '"unsafe"'
pub async unsafe fn async_unsafe_fn() {}
// @count - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" 2
// @has - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" '"const"'
// @has - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header[*]" '"unsafe"'
pub const unsafe fn const_unsafe_fn() {}

View file

@ -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() {}
}