PistonDevelopers/rust-event — pull request #98 by Indiv0 (2014-08-21 19:16:41+00:00)
Title: Add Cargo Support & Update Rust

Add a Cargo.toml and update to the new Rust import system.

Closes https://github.com/PistonDevelopers/rust-event/issues/74.

However, this does not compile as there are various lifetime errors which I'm not sure how to fix:

Updating git repository `https://github.com/PistonDevelopers/piston`
Updating git repository `https://github.com/pistondevelopers/shader_version`
Updating git repository `https://github.com/pistondevelopers/cam`
Updating git repository `https://github.com/pistondevelopers/input`
Updating git repository `https://github.com/pistondevelopers/vecmath`
Updating git repository `https://github.com/pistondevelopers/rust-graphics`
Updating git repository `https://github.com/pistondevelopers/rust-image`
Running `rustc src/lib.rs --crate-name graphics --crate-type lib -C metadata=ab29a476f787ded6 -C extra-filename=-ab29a476f787ded6 --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/graphics-ab29a476f787ded6/dep-lib-graphics -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps --extern vecmath=/home/indiv0/projects/piston/rust-event/target/deps/libvecmath-cb72b1b0b9fb4b3e.rlib`
Running `rustc src/lib.rs --crate-name piston --crate-type lib -C metadata=84163e5ca344ca3d -C extra-filename=-84163e5ca344ca3d --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/piston-84163e5ca344ca3d/dep-lib-piston -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps --extern graphics=/home/indiv0/projects/piston/rust-event/target/deps/libgraphics-ab29a476f787ded6.rlib --extern shader_version=/home/indiv0/projects/piston/rust-event/target/deps/libshader_version-be2bb9fb7463fbbb.rlib --extern vecmath=/home/indiv0/projects/piston/rust-event/target/deps/libvecmath-cb72b1b0b9fb4b3e.rlib --extern image=/home/indiv0/projects/piston/rust-event/target/deps/libimage-81921c4d82795555.rlib --extern cam=/home/indiv0/projects/piston/rust-event/target/deps/libcam-690682aee8e5181f.rlib --extern input=/home/indiv0/projects/piston/rust-event/target/deps/libinput-0f8d5acb58e11f21.rlib`
Running `rustc src/lib.rs --crate-name cam --crate-type lib -C metadata=690682aee8e5181f -C extra-filename=-690682aee8e5181f --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/cam-690682aee8e5181f/dep-lib-cam -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps --extern vecmath=/home/indiv0/projects/piston/rust-event/target/deps/libvecmath-cb72b1b0b9fb4b3e.rlib --extern input=/home/indiv0/projects/piston/rust-event/target/deps/libinput-0f8d5acb58e11f21.rlib`
Running `rustc src/lib.rs --crate-name input --crate-type lib -C metadata=0f8d5acb58e11f21 -C extra-filename=-0f8d5acb58e11f21 --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/input-0f8d5acb58e11f21/dep-lib-input -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps`
Running `rustc src/lib.rs --crate-name vecmath --crate-type lib -C metadata=cb72b1b0b9fb4b3e -C extra-filename=-cb72b1b0b9fb4b3e --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/vecmath-cb72b1b0b9fb4b3e/dep-lib-vecmath -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps`
Running `rustc src/lib.rs --crate-name image --crate-type lib -C metadata=81921c4d82795555 -C extra-filename=-81921c4d82795555 --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/image-81921c4d82795555/dep-lib-image -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps`
Running `rustc src/lib.rs --crate-name shader_version --crate-type lib -C metadata=be2bb9fb7463fbbb -C extra-filename=-be2bb9fb7463fbbb --out-dir /home/indiv0/projects/piston/rust-event/target/deps --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/shader_version-be2bb9fb7463fbbb/dep-lib-shader_version -L /home/indiv0/projects/piston/rust-event/target/deps -L /home/indiv0/projects/piston/rust-event/target/deps`
Running `rustc src/lib.rs --crate-name rust-event --crate-type lib -C metadata=a16819481018dcce -C extra-filename=-a16819481018dcce --out-dir /home/indiv0/projects/piston/rust-event/target --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/rust-event-a16819481018dcce/dep-lib-rust-event -L /home/indiv0/projects/piston/rust-event/target -L /home/indiv0/projects/piston/rust-event/target/deps --extern piston=/home/indiv0/projects/piston/rust-event/target/deps/libpiston-84163e5ca344ca3d.rlib`
Fresh shader_version v0.0.0 (https://github.com/pistondevelopers/shader_version#dfa7eea9)
Fresh input v0.0.0 (https://github.com/pistondevelopers/input#f5e25934)
Fresh vecmath v0.0.0 (https://github.com/pistondevelopers/vecmath#e89dbec3)
Fresh image v0.0.0 (https://github.com/pistondevelopers/rust-image#fd3f8f59)
Fresh cam v0.0.0 (https://github.com/pistondevelopers/cam#8b5da830)
Fresh graphics v0.0.0 (https://github.com/pistondevelopers/rust-graphics#92b2288b)
Fresh piston v0.0.0 (https://github.com/PistonDevelopers/piston#b7dc9ffb)
Compiling rust-event v0.0.0 (file:///home/indiv0/projects/piston/rust-event)
src/event.rs:44:5: 48:6 note: consider using an explicit lifetime parameter as shown: fn press(&'a self, key: &'a KeyType) -> PressEvent<'a, 'a>
src/event.rs:44 fn press(&'a self, key: &'a KeyType) -> PressEvent<'a, 'a> {
src/event.rs:45 PressEvent {
src/event.rs:46 key: Value(key),
src/event.rs:47 }
src/event.rs:48 }
src/event.rs:44:5: 48:6 error: method not compatible with trait: expected `fn(&'a event::Event<'a>, &'a event_type::KeyType) -> press_event::PressEvent<'a,'b>` but found `fn(&'a event::Event<'a>, &'a event_type::KeyType) -> press_event::PressEvent<'a,'a>` (lifetime mismatch)
src/event.rs:44 fn press(&'a self, key: &'a KeyType) -> PressEvent<'a, 'a> {
src/event.rs:45 PressEvent {
src/event.rs:46 key: Value(key),
src/event.rs:47 }
src/event.rs:48 }
src/event.rs:62:5: 66:6 note: consider using an explicit lifetime parameter as shown: fn all(&'a self, events: &'a [&'a Triggered]) -> AllEvent<'a, 'a>
src/event.rs:62 fn all(&'a self, events: &'b [&'b Triggered]) -> AllEvent<'a, 'b> {
src/event.rs:63 AllEvent {
src/event.rs:64 events: Value(events),
src/event.rs:65 }
src/event.rs:66 }
src/event.rs:62:5: 66:6 error: method not compatible with trait: expected `fn(&'a event::Event<'a>, &'a [&'a triggered::Triggered]) -> all_event::AllEvent<'a,'b>` but found `fn(&'a event::Event<'a>, &'b [&'b triggered::Triggered]) -> all_event::AllEvent<'a,'b>` (lifetime mismatch)
src/event.rs:62 fn all(&'a self, events: &'b [&'b Triggered]) -> AllEvent<'a, 'b> {
src/event.rs:63 AllEvent {
src/event.rs:64 events: Value(events),
src/event.rs:65 }
src/event.rs:66 }
src/event.rs:71:5: 75:6 note: consider using an explicit lifetime parameter as shown: fn any(&'a self, events: &'a [&'a Triggered]) -> AnyEvent<'a, 'a>
src/event.rs:71 fn any(&'a self, events: &'b [&'b Triggered]) -> AnyEvent<'a, 'b> {
src/event.rs:72 AnyEvent {
src/event.rs:73 events: Value(events),
src/event.rs:74 }
src/event.rs:75 }
src/event.rs:71:5: 75:6 error: method not compatible with trait: expected `fn(&'a event::Event<'a>, &'a [&'a triggered::Triggered]) -> any_event::AnyEvent<'a,'b>` but found `fn(&'a event::Event<'a>, &'b [&'b triggered::Triggered]) -> any_event::AnyEvent<'a,'b>` (lifetime mismatch)
src/event.rs:71 fn any(&'a self, events: &'b [&'b Triggered]) -> AnyEvent<'a, 'b> {
src/event.rs:72 AnyEvent {
src/event.rs:73 events: Value(events),
src/event.rs:74 }
src/event.rs:75 }
error: aborting due to 3 previous errors
Could not compile `rust-event`.

Caused by:
Process didn't exit successfully: `rustc src/lib.rs --crate-name rust-event --crate-type lib -C metadata=a16819481018dcce -C extra-filename=-a16819481018dcce --out-dir /home/indiv0/projects/piston/rust-event/target --dep-info /home/indiv0/projects/piston/rust-event/target/.fingerprint/rust-event-a16819481018dcce/dep-lib-rust-event -L /home/indiv0/projects/piston/rust-event/target -L /home/indiv0/projects/piston/rust-event/target/deps --extern piston=/home/indiv0/projects/piston/rust-event/target/deps/libpiston-84163e5ca344ca3d.rlib` (status=101)