]> git.lizzy.rs Git - rust.git/commit
Implement the occurs check
authorTim Chevalier <chevalier@alum.wellesley.edu>
Thu, 4 Aug 2011 01:06:57 +0000 (18:06 -0700)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Thu, 4 Aug 2011 22:30:09 +0000 (15:30 -0700)
commit2baaeab784a1f5c95deb8bd0c3a9745a969431cc
tree2737fd99c554bbd07d3acc94bb9bebbe700ea8e8
parentd7d4b4fc38aaeb153647e64564918467c92c9324
Implement the occurs check

In the writeback phase, the typechecker now checks that it isn't
replacing a type variable T with a type that contains T. It
also does an occurs check in do_autoderef in order to avoid
getting into an infinite chain of derefs.

I'm a bit worried that there are more places where the occurs
check needs to happen where I'm not doing it now, though.

Closes #768
src/comp/middle/ty.rs
src/comp/middle/typeck.rs
src/test/compile-fail/occurs-check-2.rs [new file with mode: 0644]
src/test/compile-fail/occurs-check.rs [new file with mode: 0644]