Update stdlib, compiler, and tests to new kind system

This involved adding 'copy' to more generics than I hoped, but an
experiment with making it implicit showed that that way lies madness --
unless enforced, you will not remember to mark functions that don't
copy as not requiring copyable kind.

Issue #1177
This commit is contained in:
Marijn Haverbeke 2011-11-18 12:39:20 +01:00
parent 8f8ebb550c
commit f6491bb426
94 changed files with 327 additions and 489 deletions

View file

@ -21,7 +21,7 @@ fn hash_def(d: ast::def_id) -> uint {
ret h;
}
fn new_def_hash<V>() -> std::map::hashmap<ast::def_id, V> {
fn new_def_hash<copy V>() -> std::map::hashmap<ast::def_id, V> {
let hasher: std::map::hashfn<ast::def_id> = hash_def;
let eqer: std::map::eqfn<ast::def_id> = def_eq;
ret std::map::mk_hashmap::<ast::def_id, V>(hasher, eqer);
@ -162,7 +162,7 @@ fn lit_in_range(l: @ast::lit, m1: @ast::lit, m2: @ast::lit) -> bool {
}
}
fn ranges_overlap<T>(a1: T, a2: T, b1: T, b2: T) -> bool {
fn ranges_overlap<copy T>(a1: T, a2: T, b1: T, b2: T) -> bool {
let min1 = min(a1, a2);
let max1 = max(a1, a2);
let min2 = min(b1, b2);

View file

@ -55,7 +55,7 @@ fn mk_filesearch(maybe_sysroot: option::t<fs::path>,
}
// FIXME #1001: This can't be an obj method
fn search<T>(filesearch: filesearch, pick: pick<T>) -> option::t<T> {
fn search<copy T>(filesearch: filesearch, pick: pick<T>) -> option::t<T> {
for lib_search_path in filesearch.lib_search_paths() {
log #fmt["searching %s", lib_search_path];
for path in fs::list_dir(lib_search_path) {