diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-06-17 11:23:32 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-06-17 11:35:00 -0700 |
| commit | a4d88dacc9dd70547ece3dcc65fbc61a8fcfa91d (patch) | |
| tree | 9269173bcd57a4af174a0b140bd74c8c01278a19 /src/comp | |
| parent | 2a69db5b769957c7deb89868d626b31f6e502757 (diff) | |
| download | rust-a4d88dacc9dd70547ece3dcc65fbc61a8fcfa91d.tar.gz rust-a4d88dacc9dd70547ece3dcc65fbc61a8fcfa91d.zip | |
rustc: Fail to unify if two ty_vars don't unify
Closes #500
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/ty.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index c8050eb1bc9..deaf925f0b8 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1943,7 +1943,12 @@ mod unify { alt (struct(cx.tcx, expected)) { case (ty::ty_var(?expected_id)) { auto expected_n = expected_id as uint; - union(cx, expected_n, actual_n); + alt(union(cx, expected_n, actual_n)) { + case (unres_ok) { /* fall through */ } + case (unres_err(?t_e)) { + ret ures_err(t_e); + } + } } case (_) { |
