We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// include/example.h #pragma once #include <memory> struct Object { void f() const {} };
// src/main.rs #[cxx::bridge] mod ffi { unsafe extern "C++" { include!("repro/include/example.h"); type Object<'a>; fn f(self: &Object); } } fn main() {}
The above should work (with an elided lifetime on Object but currently doesn't.
Object
error[E0726]: implicit elided lifetime not allowed here --> src/main.rs:8:21 | 8 | fn f(self: &Object); | ^^^^^^- help: indicate the anonymous lifetime: `<'_>`
Writing fn f(self: &Object<'_>) instead makes it work but shouldn't be necessary.
fn f(self: &Object<'_>)
Lifetime elision is already support in non-member functions, e.g. fn f(obj: &Object).
fn f(obj: &Object)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The above should work (with an elided lifetime on
Object
but currently doesn't.Writing
fn f(self: &Object<'_>)
instead makes it work but shouldn't be necessary.Lifetime elision is already support in non-member functions, e.g.
fn f(obj: &Object)
.The text was updated successfully, but these errors were encountered: