forked from mirrors/gecko-dev
- 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
16 lines
243 B
Rust
16 lines
243 B
Rust
use extend::ext;
|
|
|
|
trait MyTrait {}
|
|
|
|
impl MyTrait for String {}
|
|
|
|
#[ext(supertraits = Default + Clone + MyTrait)]
|
|
impl String {
|
|
fn my_len(&self) -> usize {
|
|
self.len()
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(String::new().my_len(), 0);
|
|
}
|