Fix the signature on vec::view.

Due to limitations in region inference, this has the effect of making vec::view pretty much entirely unusable.
This commit is contained in:
Eric Holk 2012-07-12 10:47:37 -07:00
parent 1a276dba52
commit aba665da32
6 changed files with 19 additions and 11 deletions

View file

@ -114,7 +114,8 @@ fn expand_nested_bindings(m: match, col: uint, val: ValueRef) -> match {
let pats = vec::append(
vec::slice(br.pats, 0u, col),
vec::append(~[inner],
vec::view(br.pats, col + 1u, br.pats.len())));
// FIXME (#2880): use view here.
vec::slice(br.pats, col + 1u, br.pats.len())));
vec::push(result,
@{pats: pats,
bound: vec::append(
@ -137,8 +138,10 @@ fn enter_match(dm: def_map, m: match, col: uint, val: ValueRef,
alt e(br.pats[col]) {
some(sub) {
let pats = vec::append(
vec::append(sub, vec::view(br.pats, 0u, col)),
vec::view(br.pats, col + 1u, br.pats.len()));
// FIXME (#2880): use view here.
vec::append(sub, vec::slice(br.pats, 0u, col)),
// FIXME (#2880): use view here.
vec::slice(br.pats, col + 1u, br.pats.len()));
let self = br.pats[col];
let bound = alt self.node {
ast::pat_ident(name, none) if !pat_is_variant(dm, self) {
@ -427,7 +430,8 @@ fn compile_submatch(bcx: block, m: match, vals: ~[ValueRef],
} else { m };
let vals_left = vec::append(vec::slice(vals, 0u, col),
vec::view(vals, col + 1u, vals.len()));
// FIXME (#2880): use view here.
vec::slice(vals, col + 1u, vals.len()));
let ccx = bcx.fcx.ccx;
let mut pat_id = 0;
for vec::each(m) |br| {

View file

@ -313,7 +313,8 @@ fn revoke_clean(cx: block, val: ValueRef) {
})) |i| {
info.cleanups =
vec::append(vec::slice(info.cleanups, 0u, i),
vec::view(info.cleanups,
// FIXME (#2880): use view here.
vec::slice(info.cleanups,
i + 1u,
info.cleanups.len()));
scope_clean_changed(info);