-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustc hangs with gordian knot of trait bounds #133354
Comments
Well, this is embarrassing. After waiting longer than I ever have before (several minutes), it does finally error with:
I'm not sure if this is worth tracking as a "the compiler is way too slow", or if it's better closed as a degenerate case. |
Next solver gives a result immediately (also an overflow), for the record. |
That's great! So I guess there's three possibilities:
This seems like its primarily a question for the rustc maintainers. Obviously I have a desire for it to work, but erroring cleanly is an A+ start :-) |
FWIW, the thing that led to this code was an implementation of perfect derives. https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/#making-perfect-derive-sound-was-tricky-but-we-can-do-it-now notes seems to indicate fundamental conceptual blockers to cyclic trait matching have been addressed, but doesn't go so far as to say they actually work :-) |
@alex: They do not work. The blog post says:
That is, the blog post is assuming theoretical support for a general trait solver feature called coinduction that we do not have. You should something between (2.) and (3.) -- it should not hang, but also I don't expect it to be successful soon (or at all, depending on how the code is written -- I didn't spend too much time actually manually reasoning the impls here are valid). |
Thanks |
Given the following code,
rustc
hangs:This is minimized from https://github.com/pyca/cryptography and https://github.com/alex/rust-asn1.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: