Currently fails to build.
error[E0261]: use of undeclared lifetime name `'a`
--> tests/ffi/lib.rs:162:59
|
23 | #[cxx::bridge(namespace = "tests")]
| - lifetime `'a` is missing in item created through this procedural macro
...
162 | fn c_take_callback_ref_lifetime<'a>(callback: fn(&'a String));
| ^^ undeclared lifetime
|
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider making the type lifetime-generic with a new `'a` lifetime
|
162 | fn c_take_callback_ref_lifetime<'a>(callback: for<'a> fn(&'a String));
| ^^^^^^^
warning: writing `&String` instead of `&str` involves a new object where a slice will do
--> tests/test.rs:207:24
|
207 | fn callback_ref(s: &String) {
| ^^^^^^^ help: change this to: `&str`
|
= note: `#[warn(clippy::ptr_arg)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Currently fails to build.
In file included from cxx-test-suite-32b8d00ca9482f5f/out/cxxbridge/crate/tests/ffi/tests.h:2,
from tests.cc:1:
cxx-test-suite-32b8d00ca9482f5f/out/cxxbridge/include/rust/cxx.h: In instantiation of ‘Ret rust::cxxbridge1::Fn<Ret(Args ...)>::operator()(Args ...) const [with Ret = void; Args = {rust::cxxbridge1::String&}]’:
tests.cc:504:18: required from here
cxx-test-suite-32b8d00ca9482f5f/out/cxxbridge/include/rust/cxx.h:478:29: error: cannot bind non-const lvalue reference of type ‘rust::cxxbridge1::String&’ to an rvalue of type ‘std::remove_reference<rust::cxxbridge1::String&>::type’ {aka ‘rust::cxxbridge1::String’}
478 | return (*this->trampoline)(std::move(args)..., this->fn);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cxx-test-suite-32b8d00ca9482f5f/out/cxxbridge/include/rust/cxx.h:478:58: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
478 | return (*this->trampoline)(std::move(args)..., this->fn);
| ^
Currently fails to build:
error[E0308]: mismatched types
--> tests/ffi/module.rs:18:1
|
18 | #[cxx::bridge(namespace = "tests")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Pin`, found `&mut _`
|
= note: expected struct `Pin<&mut other::E>`
found mutable reference `&mut _`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
because we are generating this incorrect code on the Rust side:
pub fn c_return_opaque_mut_pin(e: ::std::pin::Pin<&mut E>) -> ::std::pin::Pin<&mut E> {
extern "C" {
#[link_name = "tests$cxxbridge1$c_return_opaque_mut_pin"]
fn __c_return_opaque_mut_pin(e: *mut ::std::ffi::c_void)
-> *mut ::std::ffi::c_void;
}
unsafe {
&mut *__c_return_opaque_mut_pin(
::std::pin::Pin::into_inner_unchecked(e) as *mut E as *mut ::std::ffi::c_void
)
.cast()
}
}
Vectors have elements, not targets. (Pointers, like unique_ptr and
shared_ptr, have targets -- matching the terminology of Target in the
std::ops::Deref trait.)
warning: name `CFG` contains a capitalized acronym
--> gen/build/src/cfg.rs:350:9
|
350 | CFG,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Cfg`
|
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms