rust-lang / rust-lang/rust-bindgen
Generating `pub type j_l = u8<_Iftrue, _Iffalse>;`
Open
Nobody has claimed this yet.
A-C++
A-templates
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Input C/C++ Header
namespace std {
template <bool, typename _Iftrue, typename _Iffalse> struct a;
}
namespace {
namespace {
template <typename> struct b { template <typename> struct c; };
struct d : b<d> {};
struct e : b<e> {};
struct f : b<f> {};
struct g : b<g> {};
struct h;
template <typename... i> struct j {
typedef std::a<d::c<i...>::k, d,
std::a<e::c<i...>::k, e,
std::a<f::c<i...>::k, f, std::a<g::c<i...>::k, g, h>>>>
l;
};
} // namespace
} // namespace
Bindgen Invocation
$ $ cargo run -- problem.hpp "--blocklist-item" "std::.*" "--no-layout-tests" "--no-derive-copy" "--no-derive-debug" "--no-derive-default" "--enable-cxx-namespaces"
Actual Results
Generates (amongst other things):
pub type j_l = u8<_Iftrue, _Iffalse>;
Expected Results
A fully opaque j_l.
Note that _Iftrue and _Iffalse are on the blocklist as part of std. So maybe this is WAI? But it seems odd that we're getting a parameterized u8 at all.
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 by reproducing the issue with the embedded problem.hpp header and the cargo run invocation shown in the report. Inspect how bindgen handles the blocklisted std::a template and generates j_l. Done means the reproduced output no longer exposes parameterized u8 and instead produces a fully opaque j_l.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100