Make header a vec of modifiers, make FunctionPointer consistent with Function and Method.
This commit is contained in:
parent
36ecbc94eb
commit
a26fa74d3c
7 changed files with 85 additions and 16 deletions
5
src/test/rustdoc-json/fn_pointer/header.rs
Normal file
5
src/test/rustdoc-json/fn_pointer/header.rs
Normal 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();
|
||||
20
src/test/rustdoc-json/fns/header.rs
Normal file
20
src/test/rustdoc-json/fns/header.rs
Normal 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() {}
|
||||
24
src/test/rustdoc-json/methods/header.rs
Normal file
24
src/test/rustdoc-json/methods/header.rs
Normal 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() {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue