rust-lang / rust-lang/rust-bindgen
Wrong alignment on vectors
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
Since vectors are defined with type aliases they have an incorrect alignment.
For example this has an alignment of 8
typedef float float2 __attribute__((vector_size(2 * sizeof(float))));
The generated bindgen code is
pub type float2 = [f32; 2usize];
which has an alignment of 4 instead of the expected 8.
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
No source file, test, or entry point is named. Start by reproducing the C typedef and inspecting the generated Rust binding's alignment; done means vector aliases preserve the expected 8-byte alignment, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100