rustc: Remove some interior vectors from typestate and some useless vec-related imports
This commit is contained in:
parent
ccd0fffcce
commit
a3add84909
6 changed files with 7 additions and 26 deletions
|
@ -15,9 +15,7 @@
|
||||||
import std::int;
|
import std::int;
|
||||||
import std::str;
|
import std::str;
|
||||||
import std::uint;
|
import std::uint;
|
||||||
import std::vec;
|
|
||||||
import std::str::rustrt::sbuf;
|
import std::str::rustrt::sbuf;
|
||||||
import std::vec::rustrt::vbuf;
|
|
||||||
import std::map;
|
import std::map;
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import std::option;
|
import std::option;
|
||||||
|
@ -256,10 +254,10 @@ type fn_ctxt =
|
||||||
// Derived tydescs are tydescs created at runtime, for types that
|
// Derived tydescs are tydescs created at runtime, for types that
|
||||||
// involve type parameters inside type constructors. For example,
|
// involve type parameters inside type constructors. For example,
|
||||||
// suppose a function parameterized by T creates a vector of type
|
// suppose a function parameterized by T creates a vector of type
|
||||||
// vec[T]. The function doesn't know what T is until runtime, and the
|
// [T]. The function doesn't know what T is until runtime, and the
|
||||||
// function's caller knows T but doesn't know that a vector is
|
// function's caller knows T but doesn't know that a vector is
|
||||||
// involved. So a tydesc for vec[T] can't be created until runtime,
|
// involved. So a tydesc for [T] can't be created until runtime,
|
||||||
// when information about both "vec" and "T" are available. When such
|
// when information about both "[T]" and "T" are available. When such
|
||||||
// a tydesc is created, we cache it in the derived_tydescs table for
|
// a tydesc is created, we cache it in the derived_tydescs table for
|
||||||
// the next time that such a tydesc is needed.
|
// the next time that such a tydesc is needed.
|
||||||
hashmap[ty::t, derived_tydesc_info] derived_tydescs,
|
hashmap[ty::t, derived_tydesc_info] derived_tydescs,
|
||||||
|
|
|
@ -591,14 +591,10 @@ fn expr_to_constr(ty::ctxt tcx, &@expr e) -> constr {
|
||||||
expr_call(?operator, ?args)) {
|
expr_call(?operator, ?args)) {
|
||||||
alt (operator.node) {
|
alt (operator.node) {
|
||||||
case (expr_path(?p)) {
|
case (expr_path(?p)) {
|
||||||
// FIXME: Remove this vec->ivec conversion.
|
|
||||||
auto args_ivec = ~[];
|
|
||||||
for (@expr e in args) { args_ivec += ~[e]; }
|
|
||||||
|
|
||||||
ret respan(e.span,
|
ret respan(e.span,
|
||||||
rec(id=node_id_for_constr(tcx, operator.id),
|
rec(id=node_id_for_constr(tcx, operator.id),
|
||||||
c=npred(p, exprs_to_constr_args(tcx,
|
c=npred(p, exprs_to_constr_args(tcx,
|
||||||
args_ivec))));
|
args))));
|
||||||
}
|
}
|
||||||
case (_) {
|
case (_) {
|
||||||
tcx.sess.span_fatal(operator.span,
|
tcx.sess.span_fatal(operator.span,
|
||||||
|
@ -698,9 +694,9 @@ type inst = tup(ident, def_id);
|
||||||
type subst = tup(inst, inst)[];
|
type subst = tup(inst, inst)[];
|
||||||
|
|
||||||
fn find_instances(&fn_ctxt fcx, &subst subst, &constraint c)
|
fn find_instances(&fn_ctxt fcx, &subst subst, &constraint c)
|
||||||
-> vec[tup(uint, uint)] {
|
-> (tup(uint, uint))[] {
|
||||||
|
|
||||||
let vec[tup(uint, uint)] rslt = [];
|
let (tup(uint, uint))[] rslt = ~[];
|
||||||
if (ivec::len(subst) == 0u) {
|
if (ivec::len(subst) == 0u) {
|
||||||
ret rslt;
|
ret rslt;
|
||||||
}
|
}
|
||||||
|
@ -714,7 +710,7 @@ fn find_instances(&fn_ctxt fcx, &subst subst, &constraint c)
|
||||||
auto new = replace(subst, d);
|
auto new = replace(subst, d);
|
||||||
alt (find_instance_(new, *descs)) {
|
alt (find_instance_(new, *descs)) {
|
||||||
case (some(?d1)) {
|
case (some(?d1)) {
|
||||||
rslt += [tup(old_bit_num, d1)];
|
rslt += ~[tup(old_bit_num, d1)];
|
||||||
}
|
}
|
||||||
case (_) { }
|
case (_) { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import std::ivec;
|
import std::ivec;
|
||||||
import std::vec;
|
|
||||||
import std::vec::plus_option;
|
|
||||||
import std::vec::cat_options;
|
|
||||||
import std::option;
|
import std::option;
|
||||||
import std::option::get;
|
import std::option::get;
|
||||||
import std::option::is_none;
|
import std::option::is_none;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import std::ivec;
|
import std::ivec;
|
||||||
import std::vec;
|
|
||||||
import std::option;
|
import std::option;
|
||||||
import std::map::hashmap;
|
import std::map::hashmap;
|
||||||
import driver::session::session;
|
import driver::session::session;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
*/
|
*/
|
||||||
import std::ivec;
|
import std::ivec;
|
||||||
import std::str;
|
import std::str;
|
||||||
import std::vec;
|
|
||||||
import std::option;
|
import std::option;
|
||||||
import std::generic_os;
|
import std::generic_os;
|
||||||
import base::*;
|
import base::*;
|
||||||
|
|
|
@ -174,14 +174,6 @@ fn lit_eq(&@ast::lit l, &@ast::lit m) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME move to vec
|
|
||||||
fn any[T](&fn(&T) -> bool f, &vec[T] v) -> bool {
|
|
||||||
for (T t in v) {
|
|
||||||
if (f(t)) { ret true; }
|
|
||||||
}
|
|
||||||
ret false;
|
|
||||||
}
|
|
||||||
|
|
||||||
tag call_kind {
|
tag call_kind {
|
||||||
kind_call;
|
kind_call;
|
||||||
kind_spawn;
|
kind_spawn;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue