Closed
Description
I'm trying to use a constant at compile time to define the length of some vectors:
/* Gamma ramps */
const GLFW_GAMMA_RAMP_SIZE : int = 256;
/* Gamma ramp */
struct GLFWgammaramp {
red : [c_ushort * GLFW_GAMMA_RAMP_SIZE], // unsigned short red[GLFW_GAMMA_RAMP_SIZE];
green : [c_ushort * GLFW_GAMMA_RAMP_SIZE], // unsigned short green[GLFW_GAMMA_RAMP_SIZE];
blue : [c_ushort * GLFW_GAMMA_RAMP_SIZE] // unsigned short blue[GLFW_GAMMA_RAMP_SIZE];
}
(code from glfw3-rs)
I get this error:
% rustc test.rs
test.rs:6:26: 6:46 error: expected `]` but found `GLFW_GAMMA_RAMP_SIZE`
test.rs:6 red : [c_ushort * GLFW_GAMMA_RAMP_SIZE], // unsigned short red[GLFW_GAMMA_RAMP_SIZE];
Is this a bug or by design?