Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upClosure parameter inference and lifetime elision mayhem #24421
Comments
steveklabnik
added
the
A-closures
label
Apr 16, 2015
mbrubeck
referenced this issue
Sep 30, 2016
Closed
Confusing lifetime inference with a closure #36867
brson
added
I-wrong
T-compiler
I-nominated
labels
Dec 1, 2016
This comment has been minimized.
This comment has been minimized.
|
Needs a P- tag. |
brson
added
the
P-medium
label
Dec 1, 2016
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
rust-highfive
added
P-medium
and removed
P-medium
I-nominated
labels
Dec 1, 2016
This comment has been minimized.
This comment has been minimized.
|
oh, sorry :) |
Mark-Simulacrum
added
C-bug
and removed
C-enhancement
I-wrong
labels
Jul 22, 2017
arielb1
added
the
E-needstest
label
Nov 14, 2017
This comment has been minimized.
This comment has been minimized.
|
Looks like it was caused by the same "unexpected capture" issue as #38714 - it works on nightly. |
This comment has been minimized.
This comment has been minimized.
|
This still looks like a distinct "family of examples", so I'll at least like it to be added to the test for that issue. |
euclio
added a commit
to euclio/rust
that referenced
this issue
Oct 12, 2018
bors
added a commit
that referenced
this issue
Oct 14, 2018
bors
closed this
in
#55018
Oct 14, 2018
pnkfelix
referenced this issue
Dec 5, 2018
Closed
Shouldn't lifetime elision apply to closure return type annotation? #56537
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
frankmcsherry commentedApr 14, 2015
If you throw the following code into playpen, in the fourth case (by my reading of the error message) Rust determines an incompatible number of lifetime parameters
for<'r> core::ops::Fn<(&'r u64, &'r u64)>vs.for<'r,'r> core::ops::Fn<(&'r u64, &'r u64)>).I won't try to explain how mysterious this was, manifesting as a "sorry, you don't implement that trait" error (because the closure was not matching the type) without explaining what was awry.