Skip to content
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

"reached the recursion limit during monomorphization (selection ambiguity)" with join_all() #367

Closed
dwrensha opened this issue Jan 20, 2017 · 3 comments

Comments

@dwrensha
Copy link
Contributor

I expect the following program to compile without error.

extern crate futures; // version 0.1.9
use futures::{Future, future};

fn main() {
    let _ = future::join_all(vec![
        future::lazy(|| {
            future::ok::<(),()>(()).join(
                future::ok(()).and_then(|()| {
                    future::ok(()).map(|_| ())
                })
            )
        })
    ]);
}

Instead, rustc (stable, beta, and nightly) gives me

error: reached the recursion limit during monomorphization (selection ambiguity)

This problem seems to be related to rust-lang/rust#38033.

I am not sure whether this should be considered a rustc bug or a futures-rs bug. I think the problem could be sidestepped on the futures-rs side by making join_all()'s I::Item be an actual Future rather than an IntoFuture.

@alexcrichton
Copy link
Member

alexcrichton commented Jan 20, 2017

What in the world is wrong with join_all?!

@alexcrichton
Copy link
Member

I applied both #286 locally and removed IntoFuture in the implementation of JoinAll, but it still hit the recursion limit :\

@dwrensha
Copy link
Contributor Author

Closing, as this error no longer happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants