Skip to content

mainpage example #627

Description

@fengints

https://rust-gpu.github.io/
example in main page. Compile error

stable rust, rustc 1.96.0 (ac68faa20 2026-05-25)

error[E0580]: `main` function has wrong type
--> src/main.rs:26:1
|
26 | #[spirv(compute(threads(64)))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
= note: expected signature `fn()`
found signature `for<'a> fn(glam::UVec3, &'a mut [Option<Outcome>; 64])`
error[E0277]: the type `[Option<Outcome>]` cannot be indexed by `u32`
--> src/main.rs:32:12
|
32 | output[index] = index.fizzbuz...
| ^^^^^ slice indices are of type `usize` or ranges of `usize`
|
= help: the trait `SliceIndex<[Option<Outcome>]>` is not implemented for `u32`
help: `usize` implements trait `SliceIndex<T>`
--> /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:214:1
|
214 | unsafe impl<T> const SliceIndex<[T]> for usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SliceIndex<[T]>`
|
::: /stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/bstr/traits.rs:197:1
|
197 | unsafe impl SliceIndex<ByteStr> for usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SliceIndex<ByteStr>`
= note: required for `[Option<Outcome>]` to implement `Index<u32>`
= note: 1 redundant requirement hidden
= note: required for `[Option<Outcome>; 64]` to implement `Index<u32>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions