-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Recusion limit (selection ambiguity) reached quickly in monomorphization #40003
Comments
cc @rust-lang/compiler |
Captured a debug log from rustc_trans: https://gist.github.com/Mark-Simulacrum/55341cf99db2ab2c0739ead0533b7f28 |
Nominating for discussion. @alexcrichton how serious of a problem is this? (i.e., is it occurring a lot?) |
@nikomatsakis I haven't myself run into this much, but maybe @conradev (reporter of the original issue) has run into it more? |
I have only run into it in the situation from the original ticket (rust-lang/futures-rs#393). That said, @dwrensha also ran into the same error, but in a different situation: rust-lang/futures-rs/issues/367 (I'm not sure how related it is, if at all) |
I was able to shuffle things around a bit in my code to avoid the problem: dwrensha/zillions@da6e69c. Still, this is a very surprising and unhelpful error message to see, and I can imagine beginners getting quite confused upon seeing it. |
triage: P-medium |
Just going to plug my code here. It is a bit more of an elaborate example: https://github.com/cetra3/apache_log/tree/recursion_limit Are there any settings we can set to bump up this so-called recursion limit? Or is it hard set in the compiler. |
Ran into this as well... For what it's worth, it seems like the error message is a red herring - it doesn't look like it's a recursion depth problem, it just ends up with two ambiguous trait impls. |
It appears that this was fixed by #45065. |
Nice! I'll tag this as needstest so we can check in the test above |
How would I test it out against my code? Has this landed in nightly? |
Yes - at least, the reduced test case compiles fine with the latest nightly. |
I've tested my code on the latest nightly. Compiles fine now! |
Originally reported at rust-lang/futures-rs#393 I've minimized this example to a one-file reproduction.
I'm not really sure why it's hitting the limit so quickly, but is this a bug in the compiler or perhaps a bug in the futures crate?
The text was updated successfully, but these errors were encountered: