mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 23:29:50 +00:00
Move aux types lower in test suite
This commit is contained in:
parent
4092191f73
commit
94469c2077
104
tests/ffi/lib.rs
104
tests/ffi/lib.rs
@ -10,58 +10,6 @@ pub mod module;
|
||||
use cxx::{CxxString, CxxVector, UniquePtr};
|
||||
use std::fmt::{self, Display};
|
||||
|
||||
mod other {
|
||||
use cxx::kind::{Opaque, Trivial};
|
||||
use cxx::{type_id, CxxString, ExternType};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct D {
|
||||
pub d: u64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct E {
|
||||
e: u64,
|
||||
e_str: CxxString,
|
||||
}
|
||||
|
||||
pub mod f {
|
||||
use cxx::kind::Opaque;
|
||||
use cxx::{type_id, CxxString, ExternType};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct F {
|
||||
e: u64,
|
||||
e_str: CxxString,
|
||||
}
|
||||
|
||||
unsafe impl ExternType for F {
|
||||
type Id = type_id!("F::F");
|
||||
type Kind = Opaque;
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct G {
|
||||
pub g: u64,
|
||||
}
|
||||
|
||||
unsafe impl ExternType for G {
|
||||
type Id = type_id!("G::G");
|
||||
type Kind = Trivial;
|
||||
}
|
||||
|
||||
unsafe impl ExternType for D {
|
||||
type Id = type_id!("tests::D");
|
||||
type Kind = Trivial;
|
||||
}
|
||||
|
||||
unsafe impl ExternType for E {
|
||||
type Id = type_id!("tests::E");
|
||||
type Kind = Opaque;
|
||||
}
|
||||
}
|
||||
|
||||
#[cxx::bridge(namespace = "tests")]
|
||||
pub mod ffi {
|
||||
#[derive(Clone)]
|
||||
@ -301,6 +249,58 @@ pub mod ffi {
|
||||
}
|
||||
}
|
||||
|
||||
mod other {
|
||||
use cxx::kind::{Opaque, Trivial};
|
||||
use cxx::{type_id, CxxString, ExternType};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct D {
|
||||
pub d: u64,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct E {
|
||||
e: u64,
|
||||
e_str: CxxString,
|
||||
}
|
||||
|
||||
pub mod f {
|
||||
use cxx::kind::Opaque;
|
||||
use cxx::{type_id, CxxString, ExternType};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct F {
|
||||
e: u64,
|
||||
e_str: CxxString,
|
||||
}
|
||||
|
||||
unsafe impl ExternType for F {
|
||||
type Id = type_id!("F::F");
|
||||
type Kind = Opaque;
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct G {
|
||||
pub g: u64,
|
||||
}
|
||||
|
||||
unsafe impl ExternType for G {
|
||||
type Id = type_id!("G::G");
|
||||
type Kind = Trivial;
|
||||
}
|
||||
|
||||
unsafe impl ExternType for D {
|
||||
type Id = type_id!("tests::D");
|
||||
type Kind = Trivial;
|
||||
}
|
||||
|
||||
unsafe impl ExternType for E {
|
||||
type Id = type_id!("tests::E");
|
||||
type Kind = Opaque;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub struct R(pub usize);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user