Skip to content

Instantly share code, notes, and snippets.

@olsonjeffery
Created January 25, 2014 00:13
Show Gist options
  • Save olsonjeffery/8609548 to your computer and use it in GitHub Desktop.
Save olsonjeffery/8609548 to your computer and use it in GitHub Desktop.
error error fun time
// the offending code:
pub fn populate_world(world: &mut World<Agent>) -> Uuid {
let zone_a_id = world.new_zone(24, setup_zone);
// ....
}
/*
the error:
14:52 error: cannot determine a type for this bounded type parameter: unconstrained type
/.../builder.rs:14 let zone_a_id = world.new_zone(24, setup_zone);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// here's the impl for World, along w/ its constraints:
impl<D: Decoder, E: Encoder, TPayload: Send + Payloadable + Decodable<D> + Encodable<E>> World<TPayload> {
// ...
pub fn new_zone(&mut self, size: uint, cb: |&mut Zone<TPayload>|) -> uint {
// ..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment