vadimcn

Results 328 comments of vadimcn

Yeah, a lot has changed since last time I touched this. For example, rust toolchain now includes its own profiler runtime (albeit guarded by a feature flag), so building profiler-rt...

Asserts can be handled by generating a companion global struct for each c++ closure, which would store size/alignment of all of its arguments. The tricky bit seems to be knowing...

What if build script used `rustc` itself to parse the crate? (with a different implementation of the cpp! macro to collect c++ code). Additionally, I am thinking that rust-cpp might...

> Then it would only work with a nightly compiler, and never with stable. Why? I didn't mean to use libsyntax or anything like that, but rather spawn rustc as...

In my specific case, the struct was requested to be opaque, so maybe bindgen could use some other "filler" type? Looking at [cabi_x86_64.rs](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/cabi_x86_64.rs), it seems that some kind on weird...

Looks like this does the trick (i.e. some struct member must be misaligned): ```rust #[repr(C, packed)] struct Bar { data1: u8, data2: u16, data3: [u8; 5], } ``` Would only...

On second thought, this > An object with either a non-trivial copy constructor or a non-trivial destructor cannot be > passed by value because such objects must have well defined...

As I've said in [IRLO thread](https://internals.rust-lang.org/t/bindgen-and-c/5434), I think there are two ways we can go here: - Add support for "significant-address" c++ types in rustc via an attribute. - Have...

@retep998: It seems to me that you are describing a different problem. Is there already an open issue for it? Let's take discussion there.

bindgen could also fix up function signatures if it generated a small wrapper function. For example: ```rust extern "C" { #[link_name = "..."] fn raw_ClassMethod(this: *mut Class, ret_value: *mut SomeStruct)...