Missing occurs check leads to an infinite loop in the type checker #134921
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
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: