Auto merge of #81502 - CraftSpider:method-abi, r=jyn514
Add abi field to `Method` Also bumps version and adds a test (Will conflict with #81500, whichever is merged first) Rationale: It's possible for methods to have an ABI. This should be exposed in the JSON.
This commit is contained in:
commit
ae00b62ceb
@ -440,6 +440,7 @@ crate fn from_function_method(function: clean::Function, has_body: bool) -> Meth
|
||||
decl: decl.into(),
|
||||
generics: generics.into(),
|
||||
header: stringify_header(&header),
|
||||
abi: header.abi.to_string(),
|
||||
has_body,
|
||||
}
|
||||
}
|
||||
|
@ -294,6 +294,7 @@ pub struct Method {
|
||||
pub decl: FnDecl,
|
||||
pub generics: Generics,
|
||||
pub header: String,
|
||||
pub abi: String,
|
||||
pub has_body: bool,
|
||||
}
|
||||
|
||||
|
25
src/test/rustdoc-json/method_abi.rs
Normal file
25
src/test/rustdoc-json/method_abi.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// @has method_abi.json "$.index[*][?(@.name=='Foo')]"
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
// @has - "$.index[*][?(@.name=='abi_rust')].inner.abi" '"\"Rust\""'
|
||||
pub fn abi_rust() {}
|
||||
|
||||
// @has - "$.index[*][?(@.name=='abi_c')].inner.abi" '"\"C\""'
|
||||
pub extern "C" fn abi_c() {}
|
||||
|
||||
// @has - "$.index[*][?(@.name=='abi_system')].inner.abi" '"\"system\""'
|
||||
pub extern "system" fn abi_system() {}
|
||||
}
|
||||
|
||||
// @has method_abi.json "$.index[*][?(@.name=='Bar')]"
|
||||
pub trait Bar {
|
||||
// @has - "$.index[*][?(@.name=='trait_abi_rust')].inner.abi" '"\"Rust\""'
|
||||
fn trait_abi_rust();
|
||||
|
||||
// @has - "$.index[*][?(@.name=='trait_abi_c')].inner.abi" '"\"C\""'
|
||||
extern "C" fn trait_abi_c();
|
||||
|
||||
// @has - "$.index[*][?(@.name=='trait_abi_system')].inner.abi" '"\"system\""'
|
||||
extern "system" fn trait_abi_system();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user