Force exporting typedef
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading how cbindgen handles the export.include key in cbindgen.toml and how it discovers public Rust types referenced by exported items. Define the expected behavior for an unreferenced public typedef, then identify the relevant tests or entry point before implementing it. Done means such a type can be exported without listing each type under export.include.
Written by the indexing model from the issue text.
Description
My rust code defines some public types (functrions) . These types are not referenced by any functions, structures, enums, etc. exported by cbindgen. Still, I would like to export as typedefs in my header (without listing them all under export.include key of cbindgen.toml).
Example of such a type:
pub type ErrorCallbackType = extern "C" fn(*mut c_void, *mut c_char) -> c_void;
... it is not referenced by any code after.
What could I possibly do about it? Maybe annotate them somehow? Something like cbindgen:include (just like we have cbindgen:ignore)?..
Defining some extra symbols just for referenceing these types seems ugly to me.
- Dominant language
- Rust
- Stars
- 3k
- Forks
- 386
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/cbindgen
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in mozilla/cbindgen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100