Created
July 30, 2013 00:17
-
-
Save stepancheg/6109046 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./tmp.rs:14:27: 14:31 error: cannot infer an appropriate lifetime due to conflicting requirements | |
./tmp.rs:14 let bar: &Bar = foo as &Bar; | |
^~~~ | |
note: first, the lifetime cannot outlive lifetime re_bound(br_anon(0))... | |
./tmp.rs:15:8: 15:11 note: ...due to the following expression | |
./tmp.rs:15 baz(bar); | |
^~~ | |
./tmp.rs:13:18: 16:1 note: but, the lifetime must be valid for the block at 13:18... | |
./tmp.rs:13 fn foo(foo: &Foo) { | |
./tmp.rs:14 let bar: &Bar = foo as &Bar; | |
./tmp.rs:15 baz(bar); | |
./tmp.rs:16 } | |
./tmp.rs:14:8: 14:11 note: ...due to the following expression | |
./tmp.rs:14 let bar: &Bar = foo as &Bar; | |
^~~ | |
error: aborting due to previous error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo { | |
dummy: bool, | |
} | |
trait Bar { | |
} | |
impl Bar for Foo { | |
} | |
fn baz(bar: &Bar) {} | |
fn foo(foo: &Foo) { | |
let bar: &Bar = foo as &Bar; | |
baz(bar); | |
} | |
fn main() { | |
foo(&Foo { dummy: false }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment