dtolnay / dtolnay/cxx

Improve error message on signatures containing self by value

Open
#577 2 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Rust
Stars
6.8k
Forks
423
Avg merge
1h 19m
Merged PRs (30d)
6

Description

The current error is shown as:

```console
error[cxxbridge]: unsupported signature
┌─ /dev/stdin:1:54

1 │ #[cxx::bridge] mod ffi { extern "C++" { type T; fn f(self); }}
│ ^^^^ unsupported signature
```

Instead it should say what to use instead. `&self` or `&mut self` for shared structs and opaque Rust types, `self: Pin<&mut Self>` for an opaque C++ type, `Box` or `UniquePtr` if ownership needs to be transferred depending on opaque Rust or opaque C++ type.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.