Closed
Description
edited because it no longer ICEs.
pub mod glfw {
pub struct InputState(uint);
pub static RELEASE : InputState = InputState(0);
pub static PRESS : InputState = InputState(1);
pub static REPEAT : InputState = InputState(2);
}
fn action_to_str(state: glfw::InputState) -> ~str {
use glfw::{RELEASE, PRESS, REPEAT};
match state {
RELEASE => { ~"Released" }
PRESS => { ~"Pressed" }
REPEAT => { ~"Repeated" }
_ => { ~"Unknown" }
}
}
fn main() {}
Error:
ice.rs:4:40: 4:53 error: unsupported constant expr
ice.rs:4 pub static RELEASE : InputState = InputState(0);
^~~~~~~~~~~~~