[improper_ctypes] Don't suggest raw pointers when encountering trait objects
It's unhelpful since raw pointers to trait objects are also FFI-unsafe and casting to a thin raw pointer loses the vtable. There are working solutions that _involve_ raw pointers but they're too complex to explain in one line and have serious trade offs.
This commit is contained in:
parent
9d493c897b
commit
051ea5cc9b
2 changed files with 1 additions and 3 deletions
|
|
@ -78,8 +78,6 @@ error: `extern` block uses type `std::clone::Clone` which is not FFI-safe: trait
|
|||
|
|
||||
62 | pub fn trait_type(p: &Clone); //~ ERROR uses type `std::clone::Clone`
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: consider using a raw pointer instead
|
||||
|
||||
error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:63:26
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue