rust-lang / rust-lang/rust-bindgen
--disable-name-namespacing has no effect on vtable functions
Open
Nobody has claimed this yet.
A-C++
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Input C/C++ Header
class TestClass {
public:
virtual void method() = 0;
};
Bindgen Invocation
$ bindgen input.h --vtable-generation --disable-name-namespacing header.h -- -x c++
Actual Results
#[repr(C)]
pub struct TestClass__bindgen_vtable {
pub TestClass_method: unsafe extern "C" fn(this: *mut TestClass),
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TestClass {
pub vtable_: *const TestClass__bindgen_vtable,
}
Expected Results
The TestClass prefix for TestClass_method should be removed.
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
Reproduce the issue with the shown C++ header and bindgen invocation using --vtable-generation and --disable-name-namespacing. Trace the vtable-generation and name-namespacing handling, then verify that the generated vtable function no longer includes the TestClass prefix while the expected TestClass binding remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100