-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Recursive type results in infinite recursion #32619
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
Comments
This yields the expected error on stable. That being said, I think this is the same bug as #32326. cc @nikomatsakis, what do you think? |
Ah, thanks. Missed that one in my search of possibly related bugs. FYI this isn't restricted to just enums. It also occurs with struct Foo<T> {
one: Bar<T>,
two: Bar<T>
}
struct Bar<T> {
foo: Foo<T>
} Sorry, should have mentioned this in the initial report. |
@danlrobertson my intuition tells me that this is the same bug nevertheless, but I’m waiting for @nikomatsakis to confirm it. EDIT: in the linked bug |
Ah! True... Good point... Still a bit of a newbie here |
Given the following recursive type.
rustc
will recurse overfulfill::process_predicate1
until out of memory. A brief look atRUST_LOG="debug" ...
shows.Reproducible on b678600 and 70b8b94
Interestingly, if
Foo::two
is commented out the expected error is thrown. This might be related to #22672? After some inspection withgdb
it looks like it passes the type checks.The text was updated successfully, but these errors were encountered: