-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
compiler diverges without error message when generic function has infinite instantiations #8727
Comments
This looks like polymorphic recursion, and so is covered by #4287. Closing, feel free to reopen if I've misinterpreted. |
If there is no error message, this is a bug. |
That is, a separate bug. |
This now emits a reasonable error:
Flagging as needstest. |
26398b4 fixed this and included a test for it, although I don't know if it covers enough. |
The original example from this issue is also already included in the test suite: https://github.com/rust-lang/rust/blob/776c17f476c4be92f6cfe4dab528886973ea8c03/src/test/compile-fail/issue-8727.rs so I think this can be closed. |
…dnet Add `large_include_file` lint changelog: Add [`large_include_file`] lint closes rust-lang#7005
The program below causes the compiler to diverge because instantiating generic requires an unbounded number of instantiations. Unfortunately, divergence provides no information to the user about what went wrong. Hopefully there is some way for the compiler to detect this scenario and report it.
The text was updated successfully, but these errors were encountered: