rust-lang / rust-lang/rust-bindgen

can not get the non-type template arg?

Open
#2,825 0 comments 0 reactions 0 assignees View on GitHub

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
#pragma once

#include <stdint.h>
#include <string.h>

#include <string.h>

namespace hello
{
        template <typename T, std::size_t N>
        struct Array final
        {
            using iterator = T *;
            using size_type = std::size_t;
            void fill(const T &u) {}
            constexpr Array() { this->len = 0; }
            iterator begin() noexcept {}

        private:
            T container[N];
            size_type len;
        };

        void test_template_array(Array<int, 10> &arr);
    }
}

Bindgen Invocation

I hacked bindgen ir mod, and this function sig TemplateInstantiation can not found 10 in Array<int, 10>

Expected Results

i want to got test_template_array func correctly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the IR module around TemplateInstantiation and reproduce the reported Array<int, 10> input. Determine how the non-type argument 10 is represented, then verify that test_template_array receives the expected generated binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.