Closed
Description
Rust: master (0.10-pre)
OS: Mac OS X 10.9
Architecture: x86_64
There is some syntax that supposedly should work (according to both my experience and those on the rust irc channel) that results in a compilation error:
pub fn set_game_state<T: GameState>(&mut self, state: ~T) {
self.state = state;
}
This results in a compilation error of:
error: mismatched types: expected `~game_state::GameState:Send` but found `~T` (expected trait game_state::GameState but found ~-ptr)
This code does work:
pub fn set_game_state(&mut self, state: ~GameState) {
self.state = state;
}
Metadata
Metadata
Assignees
Labels
No labels