diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-08-23 18:09:30 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-08-23 18:55:37 -0700 |
| commit | 18576e55f72b9bdcb0998870377e09b02b033f8b (patch) | |
| tree | 1a7d6f1d2c8c56340380a32c01c75747bfda47d1 /src | |
| parent | c1f239424534af38fd1dfab861fab6813c1c9c97 (diff) | |
| download | rust-18576e55f72b9bdcb0998870377e09b02b033f8b.tar.gz rust-18576e55f72b9bdcb0998870377e09b02b033f8b.zip | |
Resolve a number of FIXMEs
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/metadata/encoder.rs | 4 | ||||
| -rw-r--r-- | src/lib/io.rs | 8 | ||||
| -rw-r--r-- | src/lib/test.rs | 2 | ||||
| -rw-r--r-- | src/lib/uint.rs | 3 | ||||
| -rw-r--r-- | src/test/run-pass/item-attributes.rs | 3 | ||||
| -rw-r--r-- | src/test/run-pass/tag.rs | 4 | ||||
| -rw-r--r-- | src/test/stdtest/bitv.rs | 2 | ||||
| -rw-r--r-- | src/test/stdtest/map.rs | 33 |
8 files changed, 10 insertions, 49 deletions
diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index 6ecd8c21f7a..b2d76729361 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -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); diff --git a/src/lib/io.rs b/src/lib/io.rs index 454cfd1041f..76608e5e956 100644 --- a/src/lib/io.rs +++ b/src/lib/io.rs @@ -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)); } diff --git a/src/lib/test.rs b/src/lib/test.rs index 72e5eb75597..09ea61dc5d7 100644 --- a/src/lib/test.rs +++ b/src/lib/test.rs @@ -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 = diff --git a/src/lib/uint.rs b/src/lib/uint.rs index 94517b29f27..657138cea9c 100644 --- a/src/lib/uint.rs +++ b/src/lib/uint.rs @@ -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; diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 352fa4ac53e..93e54d56bc9 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -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 { } } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index 534ab1dc395..12ac2614efe 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -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(); } diff --git a/src/test/stdtest/bitv.rs b/src/test/stdtest/bitv.rs index 249a43be13b..348ee3955dc 100644 --- a/src/test/stdtest/bitv.rs +++ b/src/test/stdtest/bitv.rs @@ -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)); } diff --git a/src/test/stdtest/map.rs b/src/test/stdtest/map.rs index 2da579cf472..aef78448d56 100644 --- a/src/test/stdtest/map.rs +++ b/src/test/stdtest/map.rs @@ -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); |
