Skip to content

Instantly share code, notes, and snippets.

@olsonjeffery
Created December 10, 2013 00:45
Show Gist options
  • Save olsonjeffery/7883899 to your computer and use it in GitHub Desktop.
Save olsonjeffery/7883899 to your computer and use it in GitHub Desktop.
src/client/hf/ux/mod.rs:20:19: 20:20 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/client/hf/ux/mod.rs:20 world: w,
^
src/client/hf/ux/mod.rs:18:69: 23:5 note: first, the lifetime cannot outlive the lifetime &'a as defined on the block at 18:69...
src/client/hf/ux/mod.rs:18 pub fn new<'a>(w: &'a mut World, d: &'a GameDisplay) -> ZoneView {
src/client/hf/ux/mod.rs:19 ZoneView {
src/client/hf/ux/mod.rs:20 world: w,
src/client/hf/ux/mod.rs:21 display: d
src/client/hf/ux/mod.rs:22 }
src/client/hf/ux/mod.rs:23 }
src/client/hf/ux/mod.rs:20:19: 20:20 note: ...so that borrowed pointer does not outlive borrowed content
src/client/hf/ux/mod.rs:20 world: w,
^
src/client/hf/ux/mod.rs:18:69: 23:5 note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the block at 18:69...
src/client/hf/ux/mod.rs:18 pub fn new<'a>(w: &'a mut World, d: &'a GameDisplay) -> ZoneView {
src/client/hf/ux/mod.rs:19 ZoneView {
src/client/hf/ux/mod.rs:20 world: w,
src/client/hf/ux/mod.rs:21 display: d
src/client/hf/ux/mod.rs:22 }
src/client/hf/ux/mod.rs:23 }
src/client/hf/ux/mod.rs:19:8: 19:16 note: ...so that types are compatible (expected `hf::ux::ZoneView<>` but found `hf::ux::ZoneView<>`)
src/client/hf/ux/mod.rs:19 ZoneView {
^~~~~~~~
error: aborting due to previous error
pub struct ZoneView<'a> {
world: &'a mut World,
display: &'a Display
}
impl<'a> ZoneView<'a> {
pub fn new<'a>(w: &'a mut World, d: &'a GameDisplay) -> ZoneView {
ZoneView {
world: w,
display: d
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment