We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like std::mem::offset_of isn't supported yet
std::mem::offset_of
src/lib.rs:
src/lib.rs
struct A { a: bool, } pub const offset: usize = std::mem::offset_of!(A, a);
$ cbindgen --config template.toml --crate repro --output my_header.h WARN: Skip repro::offset - (Unsupported expression. Macro(ExprMacro { attrs: [], mac: Macro { path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(std), arguments: None }, Colon2, PathSegment { ident: Ident(mem), arguments: None }, Colon2, PathSegment { ident: Ident(offset_of), arguments: None }] }, bang_token: Bang, delimiter: Paren(Paren), tokens: TokenStream [Ident { sym: A }, Punct { char: ',', spacing: Alone }, Ident { sym: a }] } }))
The text was updated successfully, but these errors were encountered:
This seems generally hard because we don't have compiler information. We could try to translate it to an offsetof in C / C++ perhaps tho?
offsetof
Sorry, something went wrong.
No branches or pull requests
It looks like
std::mem::offset_of
isn't supported yetsrc/lib.rs
:$ cbindgen --config template.toml --crate repro --output my_header.h WARN: Skip repro::offset - (Unsupported expression. Macro(ExprMacro { attrs: [], mac: Macro { path: Path { leading_colon: None, segments: [PathSegment { ident: Ident(std), arguments: None }, Colon2, PathSegment { ident: Ident(mem), arguments: None }, Colon2, PathSegment { ident: Ident(offset_of), arguments: None }] }, bang_token: Bang, delimiter: Paren(Paren), tokens: TokenStream [Ident { sym: A }, Punct { char: ',', spacing: Alone }, Ident { sym: a }] } }))
The text was updated successfully, but these errors were encountered: