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

Recusion limit (selection ambiguity) reached quickly in monomorphization #40003

Closed
alexcrichton opened this issue Feb 21, 2017 · 14 comments
Closed
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: Writing correctness tests. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

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?

@alexcrichton alexcrichton added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 21, 2017
@alexcrichton
Copy link
Member Author

cc @rust-lang/compiler

@alexcrichton alexcrichton removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 21, 2017
@alexcrichton alexcrichton changed the title Recusion limit (selection ambiguity) quickly in monomorphization Recusion limit (selection ambiguity) reached quickly in monomorphization Feb 21, 2017
@Mark-Simulacrum
Copy link
Member

Captured a debug log from rustc_trans: https://gist.github.com/Mark-Simulacrum/55341cf99db2ab2c0739ead0533b7f28

@nikomatsakis nikomatsakis added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 7, 2017
@nikomatsakis
Copy link
Contributor

Nominating for discussion. @alexcrichton how serious of a problem is this? (i.e., is it occurring a lot?)

@alexcrichton
Copy link
Member Author

@nikomatsakis I haven't myself run into this much, but maybe @conradev (reporter of the original issue) has run into it more?

@conradev
Copy link

conradev commented Mar 7, 2017

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)

@dwrensha
Copy link
Contributor

dwrensha commented Mar 7, 2017

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.

@nikomatsakis
Copy link
Contributor

triage: P-medium

@cetra3
Copy link

cetra3 commented Mar 22, 2017

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.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@goffrie
Copy link
Contributor

goffrie commented Oct 6, 2017

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.

@goffrie
Copy link
Contributor

goffrie commented Oct 9, 2017

It appears that this was fixed by #45065.

@alexcrichton
Copy link
Member Author

Nice! I'll tag this as needstest so we can check in the test above

@alexcrichton alexcrichton added the E-needs-test Call for participation: Writing correctness tests. label Oct 9, 2017
@cetra3
Copy link

cetra3 commented Oct 9, 2017

How would I test it out against my code? Has this landed in nightly?

@goffrie
Copy link
Contributor

goffrie commented Oct 9, 2017

Yes - at least, the reduced test case compiles fine with the latest nightly.

@cetra3
Copy link

cetra3 commented Oct 10, 2017

I've tested my code on the latest nightly. Compiles fine now!

goffrie added a commit to goffrie/rust that referenced this issue Oct 15, 2017
bors added a commit that referenced this issue Oct 17, 2017
Add the test for #40003.

I checked that the test failed to compile on an older nightly (I tried 2017-09-29) and that it compiles against master.

Closes #40003.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: Writing correctness tests. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants