diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index b9cc1d17d1e..9b4a230c0a6 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1656,13 +1656,9 @@ fn parse_block(&parser p) -> ast::block { stmts += [stmt]; - // FIXME: crazy differentiation between conditions - // used in branches and binary expressions in rustboot - // means we cannot use && here. I know, right? - if (p.get_file_type() == SOURCE_FILE) { - if (stmt_ends_with_semi(*stmt)) { - expect(p, token::SEMI); - } + if (p.get_file_type() == SOURCE_FILE + && stmt_ends_with_semi(*stmt)) { + expect(p, token::SEMI); } } } diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 5596b83697f..bd055c1bc4e 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -5249,24 +5249,17 @@ fn trans_arg_expr(&@block_ctxt cx, &ty::arg arg, TypeRef lldestty0, val = llvm::LLVMGetUndef(lldestty0); } else if (ty::type_contains_params(cx.fcx.lcx.ccx.tcx, arg.ty)) { auto lldestty = lldestty0; - if (arg.mode == ty::mo_val) { - - // FIXME: we'd prefer to use &&, but rustboot doesn't like it - if (ty::type_is_structural(cx.fcx.lcx.ccx.tcx, e_ty)) { - lldestty = T_ptr(lldestty); - } + if (arg.mode == ty::mo_val + && ty::type_is_structural(cx.fcx.lcx.ccx.tcx, e_ty)) { + lldestty = T_ptr(lldestty); } val = bcx.build.PointerCast(val, lldestty); } - if (arg.mode == ty::mo_val) { - - // FIXME: we'd prefer to use &&, but rustboot doesn't like it - if (ty::type_is_structural(cx.fcx.lcx.ccx.tcx, e_ty)) { - // Until here we've been treating structures by pointer; - // we are now passing it as an arg, so need to load it. - - val = bcx.build.Load(val); - } + if (arg.mode == ty::mo_val + && ty::type_is_structural(cx.fcx.lcx.ccx.tcx, e_ty)) { + // Until here we've been treating structures by pointer; + // we are now passing it as an arg, so need to load it. + val = bcx.build.Load(val); } ret res(bcx, val); } diff --git a/src/lib/extfmt.rs b/src/lib/extfmt.rs index 96e8f58189a..f64756411b2 100644 --- a/src/lib/extfmt.rs +++ b/src/lib/extfmt.rs @@ -347,10 +347,8 @@ mod rt { // FIXME: This might be useful in str: but needs to be utf8 safe first fn str_init_elt(char c, uint n_elts) -> str { auto svec = vec::init_elt[u8](c as u8, n_elts); - // FIXME: Using unsafe_from_bytes because rustboot - // can't figure out the is_utf8 predicate on from_bytes? - ret str::unsafe_from_bytes(svec); + ret str::from_bytes(svec); } tag pad_mode { pad_signed; pad_unsigned; pad_nozero; } fn pad(&conv cv, str s, pad_mode mode) -> str { diff --git a/src/lib/getopts.rs b/src/lib/getopts.rs index 54c82b21531..e34e13253d4 100644 --- a/src/lib/getopts.rs +++ b/src/lib/getopts.rs @@ -78,25 +78,11 @@ fn name_str(name nm) -> str { }; } - -// FIXME rustboot workaround -fn name_eq(name a, name b) -> bool { - ret alt (a) { - case (long(?a)) { - alt (b) { - case (long(?b)) { str::eq(a, b) } - case (_) { false } - } - } - case (_) { if (a == b) { true } else { false } } - }; -} - fn find_opt(vec[opt] opts, name nm) -> option::t[uint] { auto i = 0u; auto l = vec::len[opt](opts); while (i < l) { - if (name_eq(opts.(i).name, nm)) { ret some[uint](i); } + if (opts.(i).name == nm) { ret some[uint](i); } i += 1u; } ret none[uint]; diff --git a/src/lib/sha1.rs b/src/lib/sha1.rs index 7ec044ab394..cccfcc3de6c 100644 --- a/src/lib/sha1.rs +++ b/src/lib/sha1.rs @@ -158,11 +158,7 @@ fn mk_sha1() -> sha1 { st.msg_block_idx = 0u; } fn circular_shift(u32 bits, u32 word) -> u32 { - // FIXME: This is a workaround for a rustboot - // "unrecognized quads" codegen bug - - auto bits_hack = bits; - ret word << bits_hack | word >> 32u32 - bits; + ret word << bits | word >> 32u32 - bits; } fn mk_result(&sha1state st) -> vec[u8] { if (!st.computed) { pad_msg(st); st.computed = true; } diff --git a/src/lib/str.rs b/src/lib/str.rs index bb65e6c29c4..51b876e3253 100644 --- a/src/lib/str.rs +++ b/src/lib/str.rs @@ -302,12 +302,7 @@ fn shift_char(&mutable str s) -> char { } fn unshift_char(&mutable str s, char ch) { - // Workaround for rustboot order-of-evaluation issue -- if I put s - // directly after the +, the string ends up containing (only) the - // character, twice. - - auto x = s; - s = from_char(ch) + x; + s = from_char(ch) + s; } fn refcount(str s) -> uint {