-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone
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?
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.