mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
22 lines
385 B
Rust
22 lines
385 B
Rust
use cxx::CxxVector;
|
|
|
|
#[cxx::bridge]
|
|
mod ffi {
|
|
extern "C++" {
|
|
type ThreadSafe;
|
|
type NotThreadSafe;
|
|
}
|
|
|
|
impl CxxVector<ThreadSafe> {}
|
|
impl CxxVector<NotThreadSafe> {}
|
|
}
|
|
|
|
unsafe impl Send for ffi::ThreadSafe {}
|
|
|
|
fn assert_send<T: Send>() {}
|
|
|
|
fn main() {
|
|
assert_send::<CxxVector<ffi::ThreadSafe>>();
|
|
assert_send::<CxxVector<ffi::NotThreadSafe>>();
|
|
}
|