diff options
| author | bors <bors@rust-lang.org> | 2021-02-07 10:59:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-07 10:59:41 +0000 |
| commit | ae00b62ceb7eaf1f02f5289ab233bf7e0e8060d5 (patch) | |
| tree | ffbfb1a2f1519c9e1a9eab943889f1fa294f3d0d /src/test | |
| parent | 43e1ea29c4e92dfa2ba716fc878984605897fb13 (diff) | |
| parent | ac75fafd1c254dd96a22a289fcad18287875f061 (diff) | |
| download | rust-ae00b62ceb7eaf1f02f5289ab233bf7e0e8060d5.tar.gz rust-ae00b62ceb7eaf1f02f5289ab233bf7e0e8060d5.zip | |
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.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-json/method_abi.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/rustdoc-json/method_abi.rs b/src/test/rustdoc-json/method_abi.rs new file mode 100644 index 00000000000..6fabbc83611 --- /dev/null +++ b/src/test/rustdoc-json/method_abi.rs @@ -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(); +} |
