-
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 loop forever in case of polymorphic recursion #8613
Comments
There are several issues about this (or things similar to this):
I'm going to close this as a dupe of #7587 specifically. To answer your questions about support in Rust; this comment:
(There's a variety of other discussion about this on those issues also.) |
thank you huonw for the reply |
Most definitely; that requirement is covered by the issues that I linked. :) (In fact, #4287 is explicitly about this problem.) |
Possibly a dup of #8613 but I'm not sure. Reopening for now. |
@nikomatsakis surely this isn't a dup of itself? |
@cmr indeed. Not sure which issue I was thinking of now :) |
what about generating a (configurable) fixed number of implementations: for and failing at runtime if more depth is needed. |
This does in fact seem to be a dup of #4287, at least, that's the only way this is going to be improved. So I'm giving it a close. |
…giraffate `needless_late_init`: ignore `if let`, `let mut` and significant drops No longer lints `if let`, personal taste on this one is pretty split, so it probably shouldn't be warning by default. Fixes rust-lang#8613 ```rust let x = if let Some(n) = y { n } else { 1 } ``` No longer lints `let mut`, things like the following are not uncommon and look fine as they are https://github.com/shepmaster/twox-hash/blob/b169c16d86eb8ea4a296b0acb9d00ca7e3c3005f/src/sixty_four.rs#L88-L93 Avoids changing the drop order in an observable way, where the type of `x` has a drop with side effects and something between `x` and the first use also does, e.g. https://github.com/denoland/rusty_v8/blob/48cc6cb791cac57d22fab1a2feaa92da8ddc9a68/tests/test_api.rs#L159-L167 The implementation of `type_needs_ordered_drop_inner` was changed a bit, it now uses `Ty::has_significant_drop` and reordered the ifs to check diagnostic name before checking the implicit drop impl changelog: [`needless_late_init`]: No longer lints `if let` statements, `let mut` bindings and no longer significantly changes drop order
Hello,
rustc goes into an infinite loop when compiling this
here is what i was doing
I think that the problem is that Rust does not support polymorphic recursion which is undecidable and requires the use of a semi-algorithm or programmer supplied type annotations according to this http://en.wikipedia.org/wiki/Polymorphic_recursion -> http://dl.acm.org/citation.cfm?doid=169701.169692
i found the info about this polymorphic recursion thing in the link 2 (FingerTree.pdf)
rustc
should identify the problem and report an error rather than looping foreverOne more question: is it feasible to support this kind of things in Rust ?
Thanks
The text was updated successfully, but these errors were encountered: