Skip to content

Commit 2b87b16

Browse files
authored
Merge pull request #233 from dtolnay/ui
Unbreak ui tests
2 parents bbd2620 + 6911d6d commit 2b87b16

7 files changed

+16
-5
lines changed

tests/ffi/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ pub mod ffi {
6464
fn c_take_rust_vec_shared_forward_iterator(v: Vec<Shared>);
6565
fn c_take_ref_rust_vec(v: &Vec<u8>);
6666
fn c_take_ref_rust_vec_copy(v: &Vec<u8>);
67+
/*
68+
// https://github.com/dtolnay/cxx/issues/232
6769
fn c_take_callback(callback: fn(String) -> usize);
70+
*/
6871
fn c_take_enum(e: Enum);
6972

7073
fn c_try_return_void() -> Result<()>;

tests/ffi/tests.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,12 @@ void c_take_ref_rust_vec_copy(const rust::Vec<uint8_t> &v) {
249249
}
250250
}
251251

252+
/*
253+
// https://github.com/dtolnay/cxx/issues/232
252254
void c_take_callback(rust::Fn<size_t(rust::String)> callback) {
253255
callback("2020");
254256
}
257+
*/
255258

256259
void c_take_enum(Enum e) {
257260
if (e == Enum::AVal) {

tests/ffi/tests.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ void c_take_rust_vec_shared(rust::Vec<Shared> v);
6969
void c_take_rust_vec_shared_forward_iterator(rust::Vec<Shared> v);
7070
void c_take_ref_rust_vec(const rust::Vec<uint8_t> &v);
7171
void c_take_ref_rust_vec_copy(const rust::Vec<uint8_t> &v);
72+
/*
73+
// https://github.com/dtolnay/cxx/issues/232
7274
void c_take_callback(rust::Fn<size_t(rust::String)> callback);
75+
*/
7376
void c_take_enum(Enum e);
7477

7578
void c_try_return_void();

tests/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ fn test_c_take() {
121121
check!(ffi::c_take_enum(ffi::Enum::AVal));
122122
}
123123

124+
/*
125+
// https://github.com/dtolnay/cxx/issues/232
124126
#[test]
125127
fn test_c_callback() {
126128
fn callback(s: String) -> usize {
@@ -132,6 +134,7 @@ fn test_c_callback() {
132134
133135
check!(ffi::c_take_callback(callback));
134136
}
137+
*/
135138

136139
#[test]
137140
fn test_c_call_r() {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0004]: non-exhaustive patterns: `A { repr: 2u8..=u8::MAX }` not covered
1+
error[E0004]: non-exhaustive patterns: `A { repr: 2_u8..=u8::MAX }` not covered
22
--> $DIR/enum_match_without_wildcard.rs:12:11
33
|
44
1 | #[cxx::bridge]
55
| -------------- `ffi::A` defined here
66
...
77
12 | match a {
8-
| ^ pattern `A { repr: 2u8..=u8::MAX }` not covered
8+
| ^ pattern `A { repr: 2_u8..=u8::MAX }` not covered
99
|
1010
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
1111
= note: the matched value is of type `ffi::A`

tests/ui/opaque_not_sized.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
55
| ^^^^^ doesn't have a size known at compile-time
66
|
77
= help: within `TypeR`, the trait `std::marker::Sized` is not implemented for `str`
8-
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
98
= note: required because it appears within the type `TypeR`

tests/ui/wrong_type_id.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0271]: type mismatch resolving `<here::StringPiece as cxx::extern_type::ExternType>::Id == (cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
1+
error[E0271]: type mismatch resolving `<here::StringPiece as cxx::ExternType>::Id == (cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
22
--> $DIR/wrong_type_id.rs:11:9
33
|
44
11 | type ByteRange = crate::here::StringPiece;
@@ -7,7 +7,7 @@ error[E0271]: type mismatch resolving `<here::StringPiece as cxx::extern_type::E
77
::: $WORKSPACE/src/extern_type.rs:110:41
88
|
99
110 | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
10-
| ------- required by this bound in `cxx::extern_type::verify_extern_type`
10+
| ------- required by this bound in `cxx::private::verify_extern_type`
1111
|
1212
= note: expected tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
1313
found tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::S, cxx::t, cxx::r, cxx::i, cxx::n, cxx::g, cxx::P, cxx::i, cxx::e, cxx::c, cxx::e)`

0 commit comments

Comments
 (0)