-
Notifications
You must be signed in to change notification settings - Fork 55
Lifetime issues with arguments to function calls that are awaited on #18
Comments
Probably related to one of rust-lang/rust#44257, rust-lang/rust#44200, or rust-lang/rust#44197 perhaps? |
I suspect, if any of them I think it's most likely to be #44257, but I wasn't totally sure. The reason for my lack of confidence was that the behavior here varies based on whether there's an explicit lifetime or the automatic one. |
Yeah I'm not sure :( Maybe let's see if this is still here after the upstream issues are fixed? |
Sounds like a plan :-) |
I believe rustc is correct here. fn f1<'a>(_: &'a [u8]) -> impl Future<Item=(), Error=()> + 'a;
fn f2<'a>(_: &'a [u8]) -> impl Future<Item=(), Error=()> + 'static; This means that |
Ah excellent point, and thanks for the diagnosis @arielb1! |
I wasn't sure if this was a Rust bug, a futures-await bug, or a duplicate of one of the several other lifetime issues :-)
I've minimized this issue down to the following code:
f2
/g2
using the default lifetimes compiles fine, howeverf1
/g1
makes the compiler sad.This was surprising to me, as I naively expected them to either both be accepted or both be rejected.
The text was updated successfully, but these errors were encountered: