rust-lang / rust-lang/rust-bindgen
Feature request: Customize pointer types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
I'd like to be able to customize the types of pointer types generated by bindgen. That is, the input:
struct foo {
int *bar;
};
would produce the output:
struct foo {
pub bar: CustomPointer<::std::os::raw::c_int>,
}
where CustomPointer is an arbitrary type path specified in configuration.
The idea here is the custom pointer type can be a safe transparent wrapper around an integer value, which can e.g. treat the pointer as belonging to another process and read it from there.
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.
Research direction
No file, test, or entry point is named in the issue. Start by tracing bindgen's pointer-type generation and configuration handling; done means a configured arbitrary type path produces the requested custom pointer type for the shown input, with coverage for the generated output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100