forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#81502 - CraftSpider:method-abi, r=jyn514
Add abi field to `Method` Also bumps version and adds a test (Will conflict with rust-lang#81500, whichever is merged first) Rationale: It's possible for methods to have an ABI. This should be exposed in the JSON.
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |