rustc: Remove some interior vectors from typestate and some useless vec-related imports
This commit is contained in:
parent
ccd0fffcce
commit
a3add84909
@ -15,9 +15,7 @@
|
||||
import std::int;
|
||||
import std::str;
|
||||
import std::uint;
|
||||
import std::vec;
|
||||
import std::str::rustrt::sbuf;
|
||||
import std::vec::rustrt::vbuf;
|
||||
import std::map;
|
||||
import std::map::hashmap;
|
||||
import std::option;
|
||||
@ -256,10 +254,10 @@ type fn_ctxt =
|
||||
// Derived tydescs are tydescs created at runtime, for types that
|
||||
// involve type parameters inside type constructors. For example,
|
||||
// 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
|
||||
// involved. So a tydesc for vec[T] can't be created until runtime,
|
||||
// when information about both "vec" and "T" are available. When such
|
||||
// involved. So a tydesc for [T] can't be created until runtime,
|
||||
// when information about both "[T]" and "T" are available. When such
|
||||
// a tydesc is created, we cache it in the derived_tydescs table for
|
||||
// the next time that such a tydesc is needed.
|
||||
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)) {
|
||||
alt (operator.node) {
|
||||
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,
|
||||
rec(id=node_id_for_constr(tcx, operator.id),
|
||||
c=npred(p, exprs_to_constr_args(tcx,
|
||||
args_ivec))));
|
||||
args))));
|
||||
}
|
||||
case (_) {
|
||||
tcx.sess.span_fatal(operator.span,
|
||||
@ -698,9 +694,9 @@ type inst = tup(ident, def_id);
|
||||
type subst = tup(inst, inst)[];
|
||||
|
||||
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) {
|
||||
ret rslt;
|
||||
}
|
||||
@ -714,7 +710,7 @@ fn find_instances(&fn_ctxt fcx, &subst subst, &constraint c)
|
||||
auto new = replace(subst, d);
|
||||
alt (find_instance_(new, *descs)) {
|
||||
case (some(?d1)) {
|
||||
rslt += [tup(old_bit_num, d1)];
|
||||
rslt += ~[tup(old_bit_num, d1)];
|
||||
}
|
||||
case (_) { }
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
import std::ivec;
|
||||
import std::vec;
|
||||
import std::vec::plus_option;
|
||||
import std::vec::cat_options;
|
||||
import std::option;
|
||||
import std::option::get;
|
||||
import std::option::is_none;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import std::ivec;
|
||||
import std::vec;
|
||||
import std::option;
|
||||
import std::map::hashmap;
|
||||
import driver::session::session;
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
import std::ivec;
|
||||
import std::str;
|
||||
import std::vec;
|
||||
import std::option;
|
||||
import std::generic_os;
|
||||
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 {
|
||||
kind_call;
|
||||
kind_spawn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user