rust-lang / rust-lang/rust-bindgen
[performance and security] should support `__attribute__((__deprecated__(MSG)))`
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Input C/C++ Header
#define DEPRECATE(f) __attribute__((__deprecated__("Use '" #f "' instead")))
DEPRECATE(bar)
int foo();
int bar();
Bindgen Invocation
bindgen::Builder::default()
.header("input.h")
.generate()
.unwrap()
Actual Results
extern "C" {
pub fn foo() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bar() -> ::std::os::raw::c_int;
}
Expected Results
bindgen mapping deprecation to rust, and should be default option
extern "C" {
{{RUST_DEPRECATION}}
pub fn foo() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bar() -> ::std::os::raw::c_int;
}
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
Start with the input.h example and the bindgen::Builder invocation shown in the issue, then reproduce the generated bindings. Done means the deprecated foo declaration receives the Rust deprecation mapping while bar remains unchanged, with the behavior enabled by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100