fune/third_party/rust/extend/tests/compile_pass/async_trait.rs
Ben Dean-Kawamura fb5bfb756d Bug 1766045 - Vendoring in Rust code for uniffi-bindgen-gecko-js r=glandium,supply-chain-reviewers
- Added `--enable-uniffi-fixtures` flag.  When set, we will compile in
  the UniFFI test fixtures into our shared Rust crate and eventually
  into `libxul`.
- Vendoring in the Rust crates needed for `uniffi-bindgen-gecko-js`

Differential Revision: https://phabricator.services.mozilla.com/D144467
2022-08-02 19:51:48 +00:00

25 lines
329 B
Rust

use extend::ext;
use async_trait::async_trait;
#[ext]
#[async_trait]
impl String {
async fn foo() -> usize {
1
}
}
#[ext]
#[async_trait]
pub impl i32 {
async fn bar() -> usize {
1
}
}
async fn foo() {
let _: usize = String::foo().await;
let _: usize = i32::bar().await;
}
fn main() {}