-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Labels
t: bugSomething isn't workingSomething isn't working
Description
Compiling this gives the following compilation errors.
const OFFSETS : [f32; 18] = [0.000000, 1.494118, 3.486275, 5.478431, 7.470588, 9.462745, 11.454902, 13.447059, 15.439216, 17.431373, 19.423529, 21.415686, 23.407843, 25.400000, 27.392157, 29.384314, 31.376471, 33.368627];
#[allow(unused_attributes)]
#[spirv(fragment)]
pub fn ps_main(
) {
OFFSETS.len();
}
Errors:
error: Cannot cast between pointer types
--> C:\Users\Jasper\.rustup\toolchains\nightly-2020-11-24-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\slice\mod.rs:95:18
|
95 | unsafe { crate::ptr::Repr { rust: self }.raw.len }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: from: *{Function} [u8; 8]
= note: to: *{Function} struct *const [f32] { *{Function} [f32], u32 }
error: Cannot cast between pointer types
--> C:\Users\Jasper\.rustup\toolchains\nightly-2020-11-24-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\slice\mod.rs:95:18
|
95 | unsafe { crate::ptr::Repr { rust: self }.raw.len }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: from: *{Function} [u8; 8]
= note: to: *{Function} struct core::ptr::FatPtr<f32> { *{Function} f32, u32 }
error: Cannot cast between pointer types
--> src\guassian.rs:8:5
|
8 | OFFSETS.len();
| ^^^^^^^
|
= note: from: *{Function} [f32; 18]
= note: to: *{Function} [f32]
error: aborting due to 3 previous errors; 1 warning emitted
Obviously this can be worked around by just hardcoding the length directly.
zicklag
Metadata
Metadata
Assignees
Labels
t: bugSomething isn't workingSomething isn't working