dtolnay/cxx

Improve error message on signatures containing self by value

オープン

#577 opened on 2020/12/13

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (253 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (4,472 個のスター)
PR merge metrics
 (平均マージ 8m) (30d で 3 merged PRs)

説明

The current error is shown as:

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<T> or UniquePtr<T> if ownership needs to be transferred depending on opaque Rust or opaque C++ type.

コントリビューターガイド