Skip to content

Commit 957e0b9

Browse files
committed
Add more optional reference tests
1 parent ee51314 commit 957e0b9

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

tests/ffi/module.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub mod ffi2 {
6060
fn c_return_ns_opaque_ptr() -> UniquePtr<F>;
6161
fn c_return_ns_unique_ptr() -> UniquePtr<H>;
6262
fn c_take_ref_ns_c(h: &H);
63+
fn c_roundtrip_opaque_opt_mut_pin_ref(e: Option<Pin<&mut E>>) -> Option<Pin<&mut E>>;
6364

6465
#[namespace = "other"]
6566
fn ns_c_take_trivial(d: D);

tests/ffi/tests.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ void c_take_ref_ns_c(const ::H::H &h) {
311311
}
312312
}
313313

314+
E *c_roundtrip_opaque_opt_mut_pin_ref(E *e) { return e; }
315+
314316
void c_take_str(rust::Str s) {
315317
if (std::string(s) == "2020") {
316318
cxx_test_suite_set_correct();

tests/ffi/tests.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void c_take_opt_mut_r(R *r);
136136
void c_take_opt_ref_c(const C *c);
137137
void c_take_opt_mut_c(C *c);
138138
void c_take_ref_ns_c(const ::H::H &h);
139+
E *c_roundtrip_opaque_opt_mut_pin_ref(E *e);
139140
void c_take_str(rust::Str s);
140141
void c_take_slice_char(rust::Slice<const char> s);
141142
void c_take_slice_shared(rust::Slice<const Shared> s);

0 commit comments

Comments
 (0)