Missing occurs check leads to an infinite loop in the type checker #134921
Labels
C-bug
Category: This is a bug.
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
Running the following code with rustc leads to an infinite loop, presumably because the type checker tries to unify the type of
x
(let's call it?a
) with(?a, ?a)
It also fills the source directory with megabytes of increasingly massive files containing the types it is trying to unify, for example (this is one of the smaller ones):
I would have expected rustc to catch this with an occurs check and produce an error message instead.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: