Resolve a number of FIXMEs
This commit is contained in:
parent
c1f2394245
commit
18576e55f7
8 changed files with 10 additions and 49 deletions
|
@ -202,7 +202,7 @@ fn encode_type(ecx: &@encode_ctxt, ebml_w: &ebml::writer, typ: ty::t) {
|
|||
@{ds: f,
|
||||
tcx: ecx.ccx.tcx,
|
||||
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
|
||||
tyencode::enc_ty(io::new_writer_(ebml_w.writer), ty_str_ctxt, typ);
|
||||
tyencode::enc_ty(io::new_writer(ebml_w.writer), ty_str_ctxt, typ);
|
||||
ebml::end_tag(ebml_w);
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ fn create_index<T>(index: &[entry<T>], hash_fn: fn(&T) -> uint) ->
|
|||
|
||||
fn encode_index<T>(ebml_w: &ebml::writer, buckets: &[@[entry<T>]],
|
||||
write_fn: fn(&io::writer, &T)) {
|
||||
let writer = io::new_writer_(ebml_w.writer);
|
||||
let writer = io::new_writer(ebml_w.writer);
|
||||
ebml::start_tag(ebml_w, tag_index);
|
||||
let bucket_locs: [uint] = [];
|
||||
ebml::start_tag(ebml_w, tag_index_buckets);
|
||||
|
|
|
@ -179,10 +179,6 @@ fn file_reader(path: str) -> reader {
|
|||
}
|
||||
|
||||
|
||||
// FIXME: Remove me once objects are exported.
|
||||
fn new_reader_(bufr: buf_reader) -> reader { ret new_reader(bufr); }
|
||||
|
||||
|
||||
// Byte buffer readers
|
||||
|
||||
// TODO: mutable? u8, but this fails with rustboot.
|
||||
|
@ -355,10 +351,6 @@ obj new_writer(out: buf_writer) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Remove me once objects are exported.
|
||||
fn new_writer_(out: buf_writer) -> writer { ret new_writer(out); }
|
||||
|
||||
fn file_writer(path: str, flags: &[fileflag]) -> writer {
|
||||
ret new_writer(file_buf_writer(path, flags));
|
||||
}
|
||||
|
|
|
@ -66,8 +66,6 @@ type opt_res = either::t<test_opts, str>;
|
|||
// Parses command line arguments into test options
|
||||
fn parse_opts(args: &[str]) : vec::is_not_empty(args) -> opt_res {
|
||||
|
||||
// FIXME (#649): Shouldn't have to check here
|
||||
check (vec::is_not_empty(args));
|
||||
let args_ = vec::tail(args);
|
||||
let opts = [getopts::optflag("ignored")];
|
||||
let match =
|
||||
|
|
|
@ -32,9 +32,6 @@ iter range(lo: uint, hi: uint) -> uint {
|
|||
}
|
||||
|
||||
fn next_power_of_two(n: uint) -> uint {
|
||||
// FIXME change |* uint(4)| below to |* uint(8) / uint(2)| and watch the
|
||||
// world explode.
|
||||
|
||||
let halfbits: uint = sys::rustrt::size_of::<uint>() * 4u;
|
||||
let tmp: uint = n - 1u;
|
||||
let shift: uint = 1u;
|
||||
|
|
|
@ -201,8 +201,7 @@ mod test_literals {
|
|||
#[mach_int = 100u32];
|
||||
#[float = 1.0];
|
||||
#[mach_float = 1.0f32];
|
||||
// FIXME (#622): Can't parse a nil literal here
|
||||
//#[nil = ()];
|
||||
#[nil = ()];
|
||||
#[bool = true];
|
||||
mod m { }
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@ tag colour { red(int, int); green; }
|
|||
fn f() {
|
||||
let x = red(1, 2);
|
||||
let y = green;
|
||||
// FIXME: needs structural equality test working.
|
||||
// assert (x != y);
|
||||
|
||||
assert (x != y);
|
||||
}
|
||||
|
||||
fn main() { f(); }
|
||||
|
|
|
@ -9,8 +9,6 @@ fn test_0_elements() {
|
|||
let exp;
|
||||
act = bitv::create(0u, false);
|
||||
exp = vec::init_elt::<uint>(0u, 0u);
|
||||
// FIXME: why can't I write vec::<uint>()?
|
||||
|
||||
assert (bitv::eq_vec(act, exp));
|
||||
}
|
||||
|
||||
|
|
|
@ -6,18 +6,13 @@ import std::map;
|
|||
import std::str;
|
||||
import std::uint;
|
||||
import std::util;
|
||||
import std::option;
|
||||
|
||||
#[test]
|
||||
fn test_simple() {
|
||||
log "*** starting test_simple";
|
||||
fn eq_uint(x: &uint, y: &uint) -> bool { ret x == y; }
|
||||
fn hash_uint(u: &uint) -> uint {
|
||||
// FIXME: can't use std::util::id since we'd be capturing a type
|
||||
// param, and presently we can't close items over type params.
|
||||
|
||||
ret u;
|
||||
}
|
||||
let hasher_uint: map::hashfn<uint> = hash_uint;
|
||||
let hasher_uint: map::hashfn<uint> = util::id;
|
||||
let eqer_uint: map::eqfn<uint> = eq_uint;
|
||||
let hasher_str: map::hashfn<str> = str::hash;
|
||||
let eqer_str: map::eqfn<str> = str::eq;
|
||||
|
@ -89,14 +84,8 @@ fn test_growth() {
|
|||
log "*** starting test_growth";
|
||||
let num_to_insert: uint = 64u;
|
||||
fn eq_uint(x: &uint, y: &uint) -> bool { ret x == y; }
|
||||
fn hash_uint(u: &uint) -> uint {
|
||||
// FIXME: can't use std::util::id since we'd be capturing a type
|
||||
// param, and presently we can't close items over type params.
|
||||
|
||||
ret u;
|
||||
}
|
||||
log "uint -> uint";
|
||||
let hasher_uint: map::hashfn<uint> = hash_uint;
|
||||
let hasher_uint: map::hashfn<uint> = util::id;
|
||||
let eqer_uint: map::eqfn<uint> = eq_uint;
|
||||
let hm_uu: map::hashmap<uint, uint> =
|
||||
map::mk_hashmap::<uint, uint>(hasher_uint, eqer_uint);
|
||||
|
@ -194,23 +183,13 @@ fn test_removal() {
|
|||
log "removing evens";
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
/**
|
||||
* FIXME (issue #150): we want to check the removed value as in the
|
||||
* following:
|
||||
|
||||
let v: util.option<uint> = hm.remove(i);
|
||||
let v = hm.remove(i);
|
||||
alt (v) {
|
||||
case (util.some::<uint>(u)) {
|
||||
option::some(u) {
|
||||
assert (u == (i * i));
|
||||
}
|
||||
case (util.none::<uint>()) { fail; }
|
||||
option::none. { fail; }
|
||||
}
|
||||
|
||||
* but we util.option is a tag type so util.some and util.none are
|
||||
* off limits until we parse the dwarf for tag types.
|
||||
*/
|
||||
|
||||
hm.remove(i);
|
||||
i += 2u;
|
||||
}
|
||||
assert (hm.size() == num_to_insert / 2u);
|
||||
|
|
Loading…
Reference in a new issue