Adrian Taylor

Results 215 comments of Adrian Taylor

Here's what `bindgen` gives us: ``` extern "C" { #[cpp_semantics(original_name("b"))] #[link_name = "\u{1}__ZN5Class1bEv"] pub fn Class_b(this: *mut root::Class) -> u8; } impl Class { #[inline] pub unsafe fn a(&mut self)...

Oh, and for completeness, here's what actually goes wrong with the test case added in #787: ``` cargo:warning=/var/folders/9l/cjqbc3ws3bxcjh6h2rykj90800m02d/T/.tmpCxKn9X/target/cxx/gen0.cxx:173:29: error: cannot initialize a variable of type '::std::uint8_t (Class::*)()' with an rvalue...

Here's the `creduce`d version: ```cpp typedef char c; typedef int d; typedef c uint8_t; typedef d e; namespace std { using ::uint8_t; template struct f; typedef f g; namespace chrono...

Running upstream bindgen `ca78ae9c41998713db0c6fa70cd21089cdb2af2c` with these arguments: ``` cargo run -- "--rust-target" "1.47" "--default-enum-style" "rust" "--blocklist-item" "rust::String" "--blocklist-item" "std::unique_ptr" "--blocklist-item" "std::weak_ptr" "--blocklist-item" "std::string" "--blocklist-item" "std::shared_ptr" "--blocklist-item" "std::vector" "--blocklist-item" "rust::Str" "--blocklist-item"...

Some manual minimization gives this: ```cpp namespace chrono { template struct i; template struct f; typedef f j; template struct i { typedef k duration; duration l; }; } //...

The final piece of the puzzle here is to create newtype wrappers for all the following. || Not cxx safe || Cxx safe || | Ident | CxxSafeIdent | |...

Hi, good question. The short answer is no - this is some way off. Here's how the plan might look. First off, we will need https://github.com/dtolnay/cxx/issues/683 - that's the heavy...

> if there is C++ code storing any reference to T then it's not safe for rust to have a *mut T, so mutability from within rust has to be...

Thanks a lot for raising this and figuring out where in the codebase to put everything. I am currently away for a while so I might not have a chance...

General comments: * There are some test failures that you should look into. #1134 is the only known test failure on main right now, so all the others are a...