-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bindgen fails with panic: "C'mon: Continue" #388
Comments
Ok, so I know why this one happens, but I don't know what are we supposed to generate there? I can't think of a valid way to translate that in rust off-hand, given rust doesn't accept template parameters on template parameters? I guess we can skip it, but then something else will come up that uses that id. I think either skipping, or marking the type as opaque automatically is the best we can do here? |
I still get a failure if I set I don't think the type in question is relevant to the interface I'm working with, so "auto-opaque" would be fine, assuming it needs to be generated at all. |
Yeah, this is a failure during parsing. We try to have a consistent view of the world before generating code... Oh well, C++, you win this time. I can't work on it right now (about to go to an exam, and today will be busy in general), but I guess propagating the error up the chain (from the |
I guess the ideal is that bindgen should be able to cope with any syntactically and type-correct C++ input, even if it has to emit placeholders for parts it can't represent in Rust. In this case, I guess the |
Yep. Maybe we can revisit once ATCs happen... Or maybe we can try to properly track everything in parsing and ir and then emit opaque types in codegen. |
On Wed, Jan 11, 2017 at 01:24:31AM -0800, Nick Fitzgerald wrote:
Or maybe we can try to properly track everything in parsing and ir and
then emit opaque types in codegen.
I think that may not be really doable, since even with less esoteric
usage of template parameters libclang starts falling short already.
We could make this fallible (unlike now) and return an invalid item that
won't be generated.
Sounds easier said than done though.
|
Should be easier with #544 which introduces a |
New stack trace after #544:
|
I ran this at commit 61636e9 and got: Warning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.
/* automatically generated by rust-bindgen 0.60.1 */
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
pub mod _bindgen_mod_id_1 {
#[allow(unused_imports)]
use self::super::super::root;
pub mod _bindgen_mod_id_2 {
#[allow(unused_imports)]
use self::super::super::super::root;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SequentialThreadId {
pub prevId: u8,
}
}
}
} is that aceptable? |
I tried this with latest /* automatically generated by rust-bindgen 0.60.1 */
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
pub mod _bindgen_mod_id_1 {
#[allow(unused_imports)]
use self::super::super::root;
pub mod _bindgen_mod_id_2 {
#[allow(unused_imports)]
use self::super::super::super::root;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SequentialThreadId {
pub prevId: u8,
}
}
}
} |
I assume this is one of the template issues @emilio has mentioned before, but here it is for completeness.
Input:
Command:
bindgen lib.i --enable-cxx-namespaces -- -x c++ -std=gnu++14
Fails with:
The text was updated successfully, but these errors were encountered: