[Migrated] GEP not implemented for type struct [_; 0]
オープン
まだ誰も着手していません。
- 主要言語
- Rust
- スター
- 3.4k
- フォーク
- 126
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1075
Old labels: t: bug
Originally creatd by kevinboulain on 2023-06-16T09:49:20Z
Expected Behaviour
This compiles fine with rustc (I guess this bit is probably eliminated?).
Example & Steps To Reproduce
I was using const generic parameters to determine the length of some arrays. At some point, a base case ended up declaring a zero-length array, like so:
#![cfg_attr(target_arch = "spirv", no_std)]
use spirv_std::spirv;
fn example<const LENGTH: usize>() {
let mut array = [0; LENGTH];
for i in 0..array.len() {
array[i] += i;
}
}
#[spirv(compute(threads(1, 1, 1)))]
pub fn compute() {
example::<0>();
}
Resulting in:
error: GEP not implemented for type struct [usize; 0] { }
--> examples/shaders/compute-shader/src/lib.rs:7:9
|
7 | array[i] += i;
| ^^^^^^^^^^^^^
System Info
- rustc: 1.71.0-nightly (1a5f8bce7 2023-05-26)
- rust-gpu: b2e5eb7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
LENGTH = 0 の const-generic 例を使用して、examples/shaders/compute-shader/src/lib.rs の失敗を再現します。まず、長さ 0 の配列型に対して報告されている GEP の処理を追跡し、既存の 0 以外の長さの動作を維持したまま、例が “GEP not implemented” エラーなしでコンパイルできれば issue は完了とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100