Skip to content

Commit b61578e

Browse files
committed
Don't unify from mutable? to immutable
Immutable is supposed to be a subtype of mutable-huh.
1 parent f7a825c commit b61578e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/comp/middle/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,6 @@ mod unify {
19521952
option::t<ast::mutability> {
19531953
if expected == actual { ret some(expected); }
19541954
if expected == ast::maybe_mut { ret some(actual); }
1955-
if actual == ast::maybe_mut { ret some(expected); }
19561955
ret none;
19571956
}
19581957
tag fn_common_res {

src/lib/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import uint::next_power_of_two;
55
import ptr::addr_of;
66

77
native "rust-intrinsic" mod rusti {
8-
fn vec_len<T>(&&v: [T]) -> uint;
8+
fn vec_len<T>(&&v: [mutable? T]) -> uint;
99
}
1010

1111
native "rust" mod rustrt {
@@ -86,7 +86,7 @@ pure fn is_not_empty<T>(v: [mutable? T]) -> bool { ret !is_empty(v); }
8686
fn head<@T>(v: [mutable? T]) : is_not_empty(v) -> T { ret v[0]; }
8787

8888
/// Returns all but the first element of a vector
89-
fn tail<@T>(v: [mutable? T]) : is_not_empty(v) -> [mutable? T] {
89+
fn tail<@T>(v: [mutable? T]) : is_not_empty(v) -> [T] {
9090
ret slice(v, 1u, len(v));
9191
}
9292

0 commit comments

Comments
 (0)