mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 23:29:50 +00:00
Add ui test of type_id mismatch
This commit is contained in:
parent
5f9e8ca1a0
commit
9f07303af1
15
tests/ui/wrong_type_id.rs
Normal file
15
tests/ui/wrong_type_id.rs
Normal file
@ -0,0 +1,15 @@
|
||||
#[cxx::bridge(namespace = folly)]
|
||||
mod here {
|
||||
extern "C" {
|
||||
type StringPiece;
|
||||
}
|
||||
}
|
||||
|
||||
#[cxx::bridge(namespace = folly)]
|
||||
mod there {
|
||||
extern "C" {
|
||||
type ByteRange = crate::here::StringPiece;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
14
tests/ui/wrong_type_id.stderr
Normal file
14
tests/ui/wrong_type_id.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0271]: type mismatch resolving `<here::StringPiece as cxx::extern_type::ExternType>::Id == (cxx::type_id::f, cxx::type_id::o, cxx::type_id::l, cxx::type_id::l, cxx::type_id::y, (), cxx::type_id::B, cxx::type_id::y, cxx::type_id::t, cxx::type_id::e, cxx::type_id::R, cxx::type_id::a, cxx::type_id::n, cxx::type_id::g, cxx::type_id::e)`
|
||||
--> $DIR/wrong_type_id.rs:8:1
|
||||
|
|
||||
8 | #[cxx::bridge(namespace = folly)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 15 elements, found one with 17 elements
|
||||
|
|
||||
::: $WORKSPACE/src/extern_type.rs:6:41
|
||||
|
|
||||
6 | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
|
||||
| ------- required by this bound in `cxx::extern_type::verify_extern_type`
|
||||
|
|
||||
= note: expected tuple `(cxx::type_id::f, cxx::type_id::o, cxx::type_id::l, cxx::type_id::l, cxx::type_id::y, (), cxx::type_id::B, cxx::type_id::y, cxx::type_id::t, cxx::type_id::e, cxx::type_id::R, cxx::type_id::a, cxx::type_id::n, cxx::type_id::g, cxx::type_id::e)`
|
||||
found tuple `(cxx::type_id::f, cxx::type_id::o, cxx::type_id::l, cxx::type_id::l, cxx::type_id::y, (), cxx::type_id::S, cxx::type_id::t, cxx::type_id::r, cxx::type_id::i, cxx::type_id::n, cxx::type_id::g, cxx::type_id::P, cxx::type_id::i, cxx::type_id::e, cxx::type_id::c, cxx::type_id::e)`
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
Loading…
Reference in New Issue
Block a user