Skip to content

Possibly Syntax Issue #12739

Closed
Closed
@kylecook80

Description

@kylecook80

I attempted to compile this code:

pub fn set_game_state<T: GameState>(&mut self, state: ~T) {
  self.state = state;
}

It gave me the error:

src/game_window.rs:37:18: 37:23 error: mismatched types: expected `~game_state::GameState:Send` but found `~T` (expected trait game_state::GameState but found ~-ptr)
src/game_window.rs:37     self.state = state;

The following code did compile:

pub fn set_game_state(&mut self, state: ~GameState) {
  self.state = state;
}

I was made aware on the IRC Chat that both of these snippets of code should have worked.

Rust Version: master (0.10-pre)
OS: Mac OSX 10.9
Architecture: x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions