Closed scovich closed 4 months ago
I think you need to use triple-dash, otherwise the comment isn't preserved by syn
Triple slash that is, sorry.
This still emits:
pub struct Foo;
impl Foo {
/// cbindgen:ignore
/// cbindgen:no-export
pub const BAR: i64 = 42;
}
This suppresses it (along with everything else inside the impl Foo
block):
pub struct Foo;
/// cbindgen:ignore
/// cbindgen:no-export
impl Foo {
pub const BAR: i64 = 42;
}
So it still seems like the annotations don't affect constants -- only the surrounding struct impl?
Starting exploring in https://github.com/mozilla/cbindgen/pull/949
It turns out /// cbindgen:XXX
annotations don't affect anything inside a struct impl block -- in fact, they're not even parsed (verified by inserting a panic!
at the NameValue
"doc" case of is_skip_item_attr)
I was able to find and add the missing should_skip_parsing
calls (https://github.com/mozilla/cbindgen/pull/949), which fixes the cbindgen:ignore
case. Still looking for the code that processes cbindgen:no-export
, tho.
Fixed by #949.
For the following rust code:
cbindgen still emits the following header code:
I haven't found any combination of annotations that can suppress it, even tho the docs suggest it should work?
For ignore:
For no-export: