rust-lang / rust-lang/rust-bindgen
Hang in the test-case from #1127 with extra assertions.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
With the fix for the panic in #1128, we get through it and generate code correctly, but on llvm 4.0 we generate a cyclic alias reference, so we get stuck resolving items in assert_every_item_in_a_module (enabled only with extra assertions).
The test is:
// bindgen-flags: -- -std=c++11
template <typename> struct A;
template <typename, typename, bool> struct _Map_base;
template <typename _Pair, typename _Traits>
struct _Map_base<_Pair, _Traits, true> {
using __hashtable_base = A<_Traits>;
using key_type = typename __hashtable_base::key_type;
using mapped_type = typename _Pair::type;
mapped_type &at(const key_type &);
};
template <typename _Pair, typename _Traits>
auto _Map_base<_Pair, _Traits, true>::at(const key_type &) -> mapped_type & {}
The method definition does surprisingly matter, so there's something fishy going on there, but I'm punting on landing the test-case for now because the fix fixes the issue, and also unblocks updating bindgen in mozilla-central.
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 provided C++11 reproducer and the extra-assertions path in assert_every_item_in_a_module, comparing behavior on LLVM 4.0. Trace why the generated cyclic alias is not resolved and confirm that the hang no longer occurs after the issue is addressed; the report notes that the method definition is significant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100