Don't unify unique boxes with different mutability

Issue #409
This commit is contained in:
Brian Anderson 2011-09-22 11:10:48 -07:00
parent 5ab0840353
commit f6ab12a3b1
2 changed files with 6 additions and 3 deletions

View File

@ -2195,11 +2195,10 @@ mod unify {
alt struct(cx.tcx, actual) {
ty::ty_uniq(actual_mt) {
let mut = expected_mt.mut;
// FIXME (409) Write a test then uncomment
/*alt unify_mut(expected_mt.mut, actual_mt.mut) {
alt unify_mut(expected_mt.mut, actual_mt.mut) {
none. { ret ures_err(terr_box_mutability); }
some(m) { mut = m; }
}*/
}
let result = unify_step(cx, expected_mt.ty, actual_mt.ty);
alt result {
ures_ok(result_mt) {

View File

@ -0,0 +1,4 @@
//error-pattern:mismatched types
fn main() {
let i: ~int = ~mutable 0;
}