rustc: Make the various constraint-related types in middle::ty use interior vectors

This commit is contained in:
Patrick Walton 2011-07-01 16:42:16 -07:00
parent 2fd46b54fb
commit 717ac3df77
7 changed files with 56 additions and 18 deletions

View file

@ -103,7 +103,7 @@ fn parse_path(@pstate st, str_def sd) -> ast::path {
}
fn parse_constr(@pstate st, str_def sd) -> @ty::constr_def {
let vec[@ast::constr_arg] args = [];
let (@ast::constr_arg)[] args = ~[];
auto sp = rec(lo=0u,hi=0u); // FIXME: use a real span
let ast::path pth = parse_path(st, sd);
let char ignore = next(st) as char;
@ -113,14 +113,15 @@ fn parse_constr(@pstate st, str_def sd) -> @ty::constr_def {
alt (peek(st) as char) {
case ('*') {
st.pos += 1u;
args += [@respan(sp, ast::carg_base)];
args += ~[@respan(sp, ast::carg_base)];
}
case (?c) {
/* how will we disambiguate between
an arg index and a lit argument? */
if (c >= '0' && c <= '9') {
// FIXME
args += [@respan(sp, ast::carg_ident((c as uint) - 48u))];
args += ~[@respan(sp,
ast::carg_ident((c as uint) - 48u))];
ignore = next(st) as char;
}
else {