-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Panic compiling futures code with impl trait in nightly #40247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, I worked around this by changing the return types of both Just changing I think this is therefore "just" that the types returned by these functions are "too complex". That seems like a fairly harsh limitation of |
I'm getting this with a simpler example: fn walk_paths(&self, parent: &FolderPath) -> impl Iterator<Item=&FolderPath> {
self.nodes.keys().filter(|p| p.is_child_of(parent))
} where |
I noticed that before the panic, I do get a normal compilation error pointing to my
|
And here's code that eventually ended up working, for comparison (returning an iterator of references, and adding the explicit lifetime) pub fn walk_paths<'a>(&'a self, parent: FolderPath) -> impl Iterator<Item=&FolderPath> + 'a {
self.nodes.keys().filter(move |p| p.is_child_of(&parent))
} |
This example relies on nightly features that were removed:
Are you still seeing this today? Any chance of an updated test case? |
(After a little work updating Rocket) this works on the latest nightly and can be closed, as far as I'm concerned. |
Closing per ^--- |
I have some futures code that causes a compiler panic:
https://github.com/OneSadCookie/padgrid
(disclaimer: I have no idea if my code makes sense!)
Snippet of the offending code:
(full source in the repo above)
The panic log:
compiler version:
The text was updated successfully, but these errors were encountered: