You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't currently support non-regular recursive types; an example of such a type is:
structFoo<A>{data:Option<Foo<Vec<A>>>}
Foo<A> is non-regular, because the recursive reference to Foo within the type is not Foo<A>, but instead is Foo<Vec<A>>.
We don't support such types today (and are unlikely to do so in the foreseeable future) because our strategy of code-generation via monomorphization breaks down for such types, which yield an infinite-sized family of instances. (We might support some cases of this in the future, if we can somehow identify some subfamily as being all representable via one piece of generated code. But that's not a question for today.)
A number of compiler passes in rustc are not really equipped to deal with such types.
We could (and should) write code to detect such types early on, (perhaps in the well-formedness checking code in wf.rs), and report an error to the user with appropriate feedback about the source of the non-regular recursion.
The text was updated successfully, but these errors were encountered:
We don't currently support non-regular recursive types; an example of such a type is:
Foo<A>
is non-regular, because the recursive reference toFoo
within the type is notFoo<A>
, but instead isFoo<Vec<A>>
.We don't support such types today (and are unlikely to do so in the foreseeable future) because our strategy of code-generation via monomorphization breaks down for such types, which yield an infinite-sized family of instances. (We might support some cases of this in the future, if we can somehow identify some subfamily as being all representable via one piece of generated code. But that's not a question for today.)
A number of compiler passes in
rustc
are not really equipped to deal with such types.We could (and should) write code to detect such types early on, (perhaps in the well-formedness checking code in wf.rs), and report an error to the user with appropriate feedback about the source of the non-regular recursion.
The text was updated successfully, but these errors were encountered: