Inconsistent lifetime inference with return impl Future
/BoxFuture
and higher ranked lifetimes
#135619
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
Compiling base line version: https://github.com/weiznich/diesel_async/blob/buggy_lifetimes/src/run_query_dsl/mod.rs#L783-L817
I encountered several inconsistent errors while working on the linked code:
Variant 1: (Remove the
async move
block and box the future directly)Results in the following compilation error:
Variant 2: Use
impl Future
for the return typeError:
I would expect all three code variations to be the "same" in terms of involved lifetimes, but two of them do not compile with rather surprising errors.
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: