Merge all 3 log syntaxes, tidy up residual misuses.
This commit is contained in:
parent
f816d8c71c
commit
389329ef1e
@ -117,8 +117,8 @@ fn get_rpath_relative_to_output(os: session::os,
|
||||
fn get_relative_to(abs1: fs::path, abs2: fs::path) -> fs::path {
|
||||
assert fs::path_is_absolute(abs1);
|
||||
assert fs::path_is_absolute(abs2);
|
||||
log #fmt("finding relative path from %s to %s",
|
||||
abs1, abs2);
|
||||
#debug("finding relative path from %s to %s",
|
||||
abs1, abs2);
|
||||
let normal1 = fs::normalize(abs1);
|
||||
let normal2 = fs::normalize(abs2);
|
||||
let split1 = str::split(normal1, os_fs::path_sep as u8);
|
||||
|
@ -105,8 +105,8 @@ fn time<T>(do_it: bool, what: str, thunk: fn@() -> T) -> T {
|
||||
let start = std::time::precise_time_s();
|
||||
let rv = thunk();
|
||||
let end = std::time::precise_time_s();
|
||||
log_err #fmt["time: %s took %s s", what,
|
||||
float::to_str(end - start, 3u)];
|
||||
#error("time: %s took %s s", what,
|
||||
float::to_str(end - start, 3u));
|
||||
ret rv;
|
||||
}
|
||||
|
||||
|
@ -135,11 +135,11 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
|
||||
}
|
||||
|
||||
fn contains(haystack: [@ast::meta_item], needle: @ast::meta_item) -> bool {
|
||||
log #fmt["looking for %s",
|
||||
syntax::print::pprust::meta_item_to_str(*needle)];
|
||||
#debug("looking for %s",
|
||||
syntax::print::pprust::meta_item_to_str(*needle));
|
||||
for item: @ast::meta_item in haystack {
|
||||
log #fmt["looking in %s",
|
||||
syntax::print::pprust::meta_item_to_str(*item)];
|
||||
#debug("looking in %s",
|
||||
syntax::print::pprust::meta_item_to_str(*item));
|
||||
if eq(item, needle) { #debug("found it!"); ret true; }
|
||||
}
|
||||
#debug("found it not :(");
|
||||
|
@ -104,8 +104,8 @@ fn metadata_matches(crate_data: @[u8], metas: [@ast::meta_item]) -> bool {
|
||||
let attrs = decoder::get_crate_attributes(crate_data);
|
||||
let linkage_metas = attr::find_linkage_metas(attrs);
|
||||
|
||||
log #fmt["matching %u metadata requirements against %u items",
|
||||
vec::len(metas), vec::len(linkage_metas)];
|
||||
#debug("matching %u metadata requirements against %u items",
|
||||
vec::len(metas), vec::len(linkage_metas));
|
||||
|
||||
#debug("crate metadata:");
|
||||
for have: @ast::meta_item in linkage_metas {
|
||||
@ -178,8 +178,8 @@ fn find_library_crate_aux(sess: session::session,
|
||||
#debug("inspecting file %s", path);
|
||||
let f: str = fs::basename(path);
|
||||
if !(str::starts_with(f, prefix) && str::ends_with(f, suffix)) {
|
||||
log #fmt["skipping %s, doesn't look like %s*%s", path, prefix,
|
||||
suffix];
|
||||
#debug("skipping %s, doesn't look like %s*%s", path, prefix,
|
||||
suffix);
|
||||
option::none
|
||||
} else {
|
||||
#debug("%s is a candidate", path);
|
||||
|
@ -37,8 +37,8 @@ fn resolve_path(cstore: cstore::cstore, cnum: ast::crate_num,
|
||||
path: [ast::ident]) ->
|
||||
[(ast::crate_num, @[u8], ast::def_id)] {
|
||||
let cm = cstore::get_crate_data(cstore, cnum);
|
||||
log #fmt("resolve_path %s in crates[%d]:%s",
|
||||
str::connect(path, "::"), cnum, cm.name);
|
||||
#debug("resolve_path %s in crates[%d]:%s",
|
||||
str::connect(path, "::"), cnum, cm.name);
|
||||
let result = [];
|
||||
for def in decoder::resolve_path(path, cm.data) {
|
||||
if def.crate == ast::local_crate {
|
||||
|
@ -1393,9 +1393,8 @@ fn lookup_external(e: env, cnum: int, ids: [ident], ns: namespace) ->
|
||||
let cname = cstore::get_crate_data(e.cstore, did.crate).name;
|
||||
let name =
|
||||
csearch::get_item_name(e.cstore, did.crate, did.node);
|
||||
log #fmt("lookup_external: %s %d, %d, %s, %s", cname,
|
||||
did.crate, did.node,
|
||||
str::connect(ids, "::"), name);
|
||||
#debug("lookup_external: %s %d, %d, %s, %s", cname,
|
||||
did.crate, did.node, str::connect(ids, "::"), name);
|
||||
e.ext_map.insert(did, vec::init(ids) + [name]);
|
||||
} else {
|
||||
e.ext_map.insert(did, ids);
|
||||
|
@ -205,8 +205,6 @@ fn type_of_inner(cx: @crate_ctxt, sp: span, t: ty::t)
|
||||
T_opaque_closure(cx)
|
||||
}
|
||||
_ {
|
||||
log_err ("type_of_inner not implemented for ",
|
||||
ty::struct(cx.tcx, t));
|
||||
fail "type_of_inner not implemented for this kind of type";
|
||||
}
|
||||
};
|
||||
@ -1759,8 +1757,8 @@ fn lazily_emit_tydesc_glue(cx: @block_ctxt, field: int,
|
||||
alt ti.take_glue {
|
||||
some(_) { }
|
||||
none. {
|
||||
log #fmt["+++ lazily_emit_tydesc_glue TAKE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("+++ lazily_emit_tydesc_glue TAKE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
let lcx = cx.fcx.lcx;
|
||||
let glue_fn =
|
||||
declare_generic_glue(lcx, ti.ty, T_glue_fn(lcx.ccx),
|
||||
@ -1769,16 +1767,16 @@ fn lazily_emit_tydesc_glue(cx: @block_ctxt, field: int,
|
||||
make_generic_glue(lcx, cx.sp, ti.ty, glue_fn,
|
||||
make_take_glue,
|
||||
ti.ty_params, "take");
|
||||
log #fmt["--- lazily_emit_tydesc_glue TAKE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("--- lazily_emit_tydesc_glue TAKE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
}
|
||||
}
|
||||
} else if field == abi::tydesc_field_drop_glue {
|
||||
alt ti.drop_glue {
|
||||
some(_) { }
|
||||
none. {
|
||||
log #fmt["+++ lazily_emit_tydesc_glue DROP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("+++ lazily_emit_tydesc_glue DROP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
let lcx = cx.fcx.lcx;
|
||||
let glue_fn =
|
||||
declare_generic_glue(lcx, ti.ty, T_glue_fn(lcx.ccx),
|
||||
@ -1787,16 +1785,16 @@ fn lazily_emit_tydesc_glue(cx: @block_ctxt, field: int,
|
||||
make_generic_glue(lcx, cx.sp, ti.ty, glue_fn,
|
||||
make_drop_glue,
|
||||
ti.ty_params, "drop");
|
||||
log #fmt["--- lazily_emit_tydesc_glue DROP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("--- lazily_emit_tydesc_glue DROP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
}
|
||||
}
|
||||
} else if field == abi::tydesc_field_free_glue {
|
||||
alt ti.free_glue {
|
||||
some(_) { }
|
||||
none. {
|
||||
log #fmt["+++ lazily_emit_tydesc_glue FREE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("+++ lazily_emit_tydesc_glue FREE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
let lcx = cx.fcx.lcx;
|
||||
let glue_fn =
|
||||
declare_generic_glue(lcx, ti.ty, T_glue_fn(lcx.ccx),
|
||||
@ -1805,19 +1803,19 @@ fn lazily_emit_tydesc_glue(cx: @block_ctxt, field: int,
|
||||
make_generic_glue(lcx, cx.sp, ti.ty, glue_fn,
|
||||
make_free_glue,
|
||||
ti.ty_params, "free");
|
||||
log #fmt["--- lazily_emit_tydesc_glue FREE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("--- lazily_emit_tydesc_glue FREE %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
}
|
||||
}
|
||||
} else if field == abi::tydesc_field_cmp_glue {
|
||||
alt ti.cmp_glue {
|
||||
some(_) { }
|
||||
none. {
|
||||
log #fmt["+++ lazily_emit_tydesc_glue CMP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("+++ lazily_emit_tydesc_glue CMP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
ti.cmp_glue = some(bcx_ccx(cx).upcalls.cmp_type);
|
||||
log #fmt["--- lazily_emit_tydesc_glue CMP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty)];
|
||||
#debug("--- lazily_emit_tydesc_glue CMP %s",
|
||||
ty_to_str(bcx_tcx(cx), ti.ty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -547,8 +547,8 @@ fn constraints(fcx: fn_ctxt) -> [norm_constraint] {
|
||||
// should freeze it at some earlier point.
|
||||
fn match_args(fcx: fn_ctxt, occs: @mutable [pred_args],
|
||||
occ: [@constr_arg_use]) -> uint {
|
||||
log "match_args: looking at " +
|
||||
constr_args_to_str(fn (i: inst) -> str { ret i.ident; }, occ);
|
||||
#debug("match_args: looking at %s",
|
||||
constr_args_to_str(fn (i: inst) -> str { ret i.ident; }, occ));
|
||||
for pd: pred_args in *occs {
|
||||
log_full(core::debug,
|
||||
"match_args: candidate " + pred_args_to_str(pd));
|
||||
@ -879,9 +879,9 @@ fn forget_in_postcond(fcx: fn_ctxt, parent_exp: node_id, dead_v: node_id) {
|
||||
some(d_id) {
|
||||
for c: norm_constraint in constraints(fcx) {
|
||||
if constraint_mentions(fcx, c, d_id) {
|
||||
log ("clearing constraint ",
|
||||
c.bit_num,
|
||||
constraint_to_str(fcx.ccx.tcx, c.c));
|
||||
#debug("clearing constraint %u %s",
|
||||
c.bit_num,
|
||||
constraint_to_str(fcx.ccx.tcx, c.c));
|
||||
clear_in_postcond(c.bit_num,
|
||||
node_id_to_ts_ann(fcx.ccx,
|
||||
parent_exp).conditions);
|
||||
|
@ -71,11 +71,11 @@ fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
|
||||
let pres: prestate = ann_prestate(a);
|
||||
|
||||
|
||||
log("check_states_stmt:");
|
||||
#debug("check_states_stmt:");
|
||||
log_full(core::debug, print::pprust::stmt_to_str(*s));
|
||||
log("prec = ");
|
||||
#debug("prec = ");
|
||||
log_tritv(fcx, prec);
|
||||
log("pres = ");
|
||||
#debug("pres = ");
|
||||
log_tritv(fcx, pres);
|
||||
|
||||
if !implies(pres, prec) {
|
||||
|
@ -154,8 +154,7 @@ fn mk_fn_info(ccx: crate_ctxt,
|
||||
i_diverge: ninit(diverges_id, diverges_name),
|
||||
used_vars: v};
|
||||
ccx.fm.insert(id, rslt);
|
||||
log name + " has " + uint::str(num_constraints(rslt)) +
|
||||
" constraints";
|
||||
#debug("%s has %u constraints", name, num_constraints(rslt));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1502,9 +1502,9 @@ fn check_expr_fn_with_unifier(fcx: @fn_ctxt,
|
||||
|
||||
let fty = ty_of_fn_decl(tcx, m_check_tyvar(fcx), decl);
|
||||
|
||||
log #fmt("check_expr_fn_with_unifier %s fty=%s",
|
||||
expr_to_str(expr),
|
||||
ty_to_str(tcx, fty));
|
||||
#debug("check_expr_fn_with_unifier %s fty=%s",
|
||||
expr_to_str(expr),
|
||||
ty_to_str(tcx, fty));
|
||||
|
||||
write::ty_only_fixup(fcx, expr.id, fty);
|
||||
|
||||
@ -1965,9 +1965,9 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
|
||||
ast::proto_block
|
||||
}
|
||||
};
|
||||
log #fmt("checking expr_fn_block %s expected=%s",
|
||||
expr_to_str(expr),
|
||||
ty_to_str(tcx, expected));
|
||||
#debug("checking expr_fn_block %s expected=%s",
|
||||
expr_to_str(expr),
|
||||
ty_to_str(tcx, expected));
|
||||
check_expr_fn_with_unifier(fcx, expr, {proto: proto with decl}, body,
|
||||
unify, expected);
|
||||
write::ty_only_fixup(fcx, id, expected);
|
||||
|
@ -30,8 +30,8 @@ fn eval_crate_directives_to_mod(cx: ctx, cdirs: [@ast::crate_directive],
|
||||
prefix: str, suffix: option::t<str>)
|
||||
-> (ast::_mod, [ast::attribute]) {
|
||||
#debug("eval crate prefix: %s", prefix);
|
||||
log #fmt("eval crate suffix: %s",
|
||||
option::from_maybe("none", suffix));
|
||||
#debug("eval crate suffix: %s",
|
||||
option::from_maybe("none", suffix));
|
||||
let (cview_items, citems, cattrs)
|
||||
= parse_companion_mod(cx, prefix, suffix);
|
||||
let view_items: [@ast::view_item] = [];
|
||||
|
@ -910,7 +910,10 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
|
||||
hi = e.span.hi;
|
||||
ex = ast::expr_fail(some(e));
|
||||
} else { ex = ast::expr_fail(none); }
|
||||
} else if eat_word(p, "log_full") {
|
||||
} else if
|
||||
(eat_word(p, "log_full")
|
||||
|| eat_word(p, "log")
|
||||
|| eat_word(p, "log_err")) {
|
||||
expect(p, token::LPAREN);
|
||||
let lvl = parse_expr(p);
|
||||
expect(p, token::COMMA);
|
||||
@ -918,14 +921,6 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
|
||||
ex = ast::expr_log(2, lvl, e);
|
||||
hi = p.get_hi_pos();
|
||||
expect(p, token::RPAREN);
|
||||
} else if eat_word(p, "log") {
|
||||
let e = parse_expr(p);
|
||||
ex = ast::expr_log(1, mk_lit_u32(p, 1u32), e);
|
||||
hi = e.span.hi;
|
||||
} else if eat_word(p, "log_err") {
|
||||
let e = parse_expr(p);
|
||||
ex = ast::expr_log(0, mk_lit_u32(p, 0u32), e);
|
||||
hi = e.span.hi;
|
||||
} else if eat_word(p, "assert") {
|
||||
let e = parse_expr(p);
|
||||
ex = ast::expr_assert(e);
|
||||
|
@ -304,11 +304,11 @@ obj printer(out: io::writer,
|
||||
}
|
||||
}
|
||||
fn check_stream() {
|
||||
log #fmt["check_stream [%u, %u] with left_total=%d, right_total=%d",
|
||||
left, right, left_total, right_total];
|
||||
#debug("check_stream [%u, %u] with left_total=%d, right_total=%d",
|
||||
left, right, left_total, right_total);
|
||||
if right_total - left_total > space {
|
||||
log #fmt["scan window is %d, longer than space on line (%d)",
|
||||
right_total - left_total, space];
|
||||
#debug("scan window is %d, longer than space on line (%d)",
|
||||
right_total - left_total, space);
|
||||
if !scan_stack_empty {
|
||||
if left == scan_stack[bottom] {
|
||||
#debug("setting %u to infinity and popping", left);
|
||||
@ -411,8 +411,8 @@ obj printer(out: io::writer,
|
||||
out.write_str(s);
|
||||
}
|
||||
fn print(x: token, L: int) {
|
||||
log #fmt["print %s %d (remaining line space=%d)", tok_str(x), L,
|
||||
space];
|
||||
#debug("print %s %d (remaining line space=%d)", tok_str(x), L,
|
||||
space);
|
||||
log_full(core::debug, buf_str(token, size, left, right, 6u));
|
||||
alt x {
|
||||
BEGIN(b) {
|
||||
|
@ -110,8 +110,7 @@ fn parse_name_value_directive(line: str,
|
||||
let value =
|
||||
str::slice(line, colon + str::byte_len(keycolon),
|
||||
str::byte_len(line));
|
||||
log #fmt("%s: %s", directive,
|
||||
value);
|
||||
#debug("%s: %s", directive, value);
|
||||
option::some(value)
|
||||
} else { option::none }
|
||||
}
|
||||
|
@ -549,10 +549,11 @@ fn check_variants(files: [str], cx: context) {
|
||||
parser::parse_crate_from_source_str(
|
||||
file,
|
||||
s, [], sess);
|
||||
log_err as_str(bind pprust::print_crate(sess.cm, crate,
|
||||
file,
|
||||
io::string_reader(s), _,
|
||||
pprust::no_ann()));
|
||||
#error("%s",
|
||||
as_str(bind pprust::print_crate(sess.cm, crate,
|
||||
file,
|
||||
io::string_reader(s), _,
|
||||
pprust::no_ann())));
|
||||
check_variants_of_ast(*crate, sess.cm, file, cx);
|
||||
}
|
||||
}
|
||||
|
@ -143,17 +143,16 @@ mod chained {
|
||||
while true {
|
||||
alt e0.next {
|
||||
absent. {
|
||||
log("search_tbl", "absent", "comparisons", comp,
|
||||
"hash", h, "idx", idx);
|
||||
|
||||
#debug("search_tbl: absent, comp %u, hash %u, idx %u",
|
||||
comp, h, idx);
|
||||
ret not_found;
|
||||
}
|
||||
present(e1) {
|
||||
comp += 1u;
|
||||
let e1_key = e1.key; // Satisfy alias checker.
|
||||
if e1.hash == h && tbl.eqer(e1_key, k) {
|
||||
log("search_tbl", "present", "comparisons", comp,
|
||||
"hash", h, "idx", idx);
|
||||
#debug("search_tbl: present, comp %u, hash %u, idx %u",
|
||||
comp, h, idx);
|
||||
ret found_after(e0, e1);
|
||||
} else {
|
||||
e0 = e1;
|
||||
@ -169,15 +168,15 @@ mod chained {
|
||||
let idx = h % vec::len(tbl.chains);
|
||||
alt tbl.chains[idx] {
|
||||
absent. {
|
||||
log("search_tbl", "absent", "comparisons", 0u,
|
||||
"hash", h, "idx", idx);
|
||||
#debug("search_tbl: absent, comp %u, hash %u, idx %u",
|
||||
0u, h, idx);
|
||||
ret not_found;
|
||||
}
|
||||
present(e) {
|
||||
let e_key = e.key; // Satisfy alias checker.
|
||||
if e.hash == h && tbl.eqer(e_key, k) {
|
||||
log("search_tbl", "present", "comparisons", 1u,
|
||||
"hash", h, "idx", idx);
|
||||
#debug("search_tbl: present, comp %u, hash %u, idx %u",
|
||||
1u, h, idx);
|
||||
ret found_first(idx, e);
|
||||
} else {
|
||||
ret search_rem(tbl, k, h, idx, e);
|
||||
|
@ -13,20 +13,20 @@ tag bottle { none; dual; single; multiple(int); }
|
||||
fn show(b: bottle) {
|
||||
alt b {
|
||||
none. {
|
||||
log "No more bottles of beer on the wall, " +
|
||||
"no more bottles of beer,";
|
||||
log "Go to the store and buy some more, " +
|
||||
"99 bottles of beer on the wall.";
|
||||
#debug("No more bottles of beer on the wall, \
|
||||
no more bottles of beer,");
|
||||
#debug("Go to the store and buy some more, \
|
||||
99 bottles of beer on the wall.");
|
||||
}
|
||||
single. {
|
||||
#debug("1 bottle of beer on the wall, 1 bottle of beer,");
|
||||
log "Take one down and pass it around, " +
|
||||
"no more bottles of beer on the wall.";
|
||||
#debug("Take one down and pass it around, \
|
||||
no more bottles of beer on the wall.");
|
||||
}
|
||||
dual. {
|
||||
#debug("2 bottles of beer on the wall, 2 bottles of beer,");
|
||||
log "Take one down and pass it around, " +
|
||||
"1 bottle of beer on the wall.";
|
||||
#debug("Take one down and pass it around, \
|
||||
1 bottle of beer on the wall.");
|
||||
}
|
||||
multiple(n) {
|
||||
#debug("%d bottles of beer on the wall, %d bottles of beer,", n, n);
|
||||
|
@ -23,16 +23,16 @@ fn main() {
|
||||
}
|
||||
fn single() {
|
||||
#debug("1 bottle of beer on the wall, 1 bottle of beer,");
|
||||
log "Take one down and pass it around, " +
|
||||
"no more bottles of beer on the wall.";
|
||||
#debug("Take one down and pass it around, \
|
||||
no more bottles of beer on the wall.");
|
||||
#debug("");
|
||||
be none();
|
||||
}
|
||||
fn none() {
|
||||
#debug("No more bottles of beer on the wall, \
|
||||
no more bottles of beer,");
|
||||
log "Go to the store and buy some more, " +
|
||||
"99 bottles of beer on the wall.";
|
||||
#debug("Go to the store and buy some more, \
|
||||
99 bottles of beer on the wall.");
|
||||
#debug("");
|
||||
}
|
||||
multiple(99);
|
||||
|
@ -28,8 +28,8 @@ fn main() {
|
||||
} else { max_depth = n; }
|
||||
let stretch_depth = max_depth + 1;
|
||||
let stretch_tree = bottom_up_tree(0, stretch_depth);
|
||||
log #fmt["stretch tree of depth %d\t check: %d", stretch_depth,
|
||||
item_check(stretch_tree)];
|
||||
#debug("stretch tree of depth %d\t check: %d", stretch_depth,
|
||||
item_check(stretch_tree));
|
||||
let long_lived_tree = bottom_up_tree(0, max_depth);
|
||||
let depth = min_depth;
|
||||
while depth <= max_depth {
|
||||
@ -43,10 +43,10 @@ fn main() {
|
||||
chk += item_check(temp_tree);
|
||||
i += 1;
|
||||
}
|
||||
log #fmt["%d\t trees of depth %d\t check: %d", iterations * 2, depth,
|
||||
chk];
|
||||
#debug("%d\t trees of depth %d\t check: %d", iterations * 2, depth,
|
||||
chk);
|
||||
depth += 2;
|
||||
}
|
||||
log #fmt["long lived trees of depth %d\t check: %d", max_depth,
|
||||
item_check(long_lived_tree)];
|
||||
#debug("long lived trees of depth %d\t check: %d", max_depth,
|
||||
item_check(long_lived_tree));
|
||||
}
|
||||
|
@ -5,14 +5,14 @@ import mod2::*;
|
||||
|
||||
mod mod1 {
|
||||
fn f1() { #debug("f1"); }
|
||||
fn common1() { log "common" }
|
||||
fn common2() { log "common" }
|
||||
fn common1() { #debug("common") }
|
||||
fn common2() { #debug("common") }
|
||||
}
|
||||
|
||||
mod mod2 {
|
||||
fn f2() { #debug("f1"); }
|
||||
fn common1() { log "common" }
|
||||
fn common2() { log "common" }
|
||||
fn common1() { #debug("common") }
|
||||
fn common2() { #debug("common") }
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,5 +19,5 @@ fn main() {
|
||||
fn child(c: chan<int>) {
|
||||
#error("sending");
|
||||
send(c, 10);
|
||||
log_err "value sent"
|
||||
#error("value sent");
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
fn main() {
|
||||
let f: fn() = fn () {
|
||||
log "This is a bare function"
|
||||
#debug("This is a bare function")
|
||||
};
|
||||
let g;
|
||||
g = f;
|
||||
|
@ -1,6 +1,6 @@
|
||||
fn main() {
|
||||
let f: fn() = fn () {
|
||||
log "This is a bare function"
|
||||
#debug("This is a bare function")
|
||||
};
|
||||
f();
|
||||
}
|
@ -94,15 +94,13 @@ fn test_growth() {
|
||||
let i: uint = 0u;
|
||||
while i < num_to_insert {
|
||||
assert (hm_uu.insert(i, i * i));
|
||||
log "inserting " + uint::to_str(i, 10u) + " -> " +
|
||||
uint::to_str(i * i, 10u);
|
||||
#debug("inserting %u -> %u", i, i*i);
|
||||
i += 1u;
|
||||
}
|
||||
#debug("-----");
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm_uu.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm_uu.get(i));
|
||||
assert (hm_uu.get(i) == i * i);
|
||||
i += 1u;
|
||||
}
|
||||
@ -112,8 +110,7 @@ fn test_growth() {
|
||||
hm_uu.rehash();
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm_uu.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm_uu.get(i));
|
||||
assert (hm_uu.get(i) == i * i);
|
||||
i += 1u;
|
||||
}
|
||||
@ -125,15 +122,17 @@ fn test_growth() {
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
assert (hm_ss.insert(uint::to_str(i, 2u), uint::to_str(i * i, 2u)));
|
||||
log "inserting \"" + uint::to_str(i, 2u) + "\" -> \"" +
|
||||
uint::to_str(i * i, 2u) + "\"";
|
||||
#debug("inserting \"%s\" -> \"%s\"",
|
||||
uint::to_str(i, 2u),
|
||||
uint::to_str(i*i, 2u));
|
||||
i += 1u;
|
||||
}
|
||||
#debug("-----");
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(\"" + uint::to_str(i, 2u) + "\") = \"" +
|
||||
hm_ss.get(uint::to_str(i, 2u)) + "\"";
|
||||
#debug("get(\"%s\") = \"%s\"",
|
||||
uint::to_str(i, 2u),
|
||||
hm_ss.get(uint::to_str(i, 2u)));
|
||||
assert (str::eq(hm_ss.get(uint::to_str(i, 2u)),
|
||||
uint::to_str(i * i, 2u)));
|
||||
i += 1u;
|
||||
@ -146,8 +145,9 @@ fn test_growth() {
|
||||
hm_ss.rehash();
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(\"" + uint::to_str(i, 2u) + "\") = \"" +
|
||||
hm_ss.get(uint::to_str(i, 2u)) + "\"";
|
||||
#debug("get(\"%s\") = \"%s\"",
|
||||
uint::to_str(i, 2u),
|
||||
hm_ss.get(uint::to_str(i, 2u)));
|
||||
assert (str::eq(hm_ss.get(uint::to_str(i, 2u)),
|
||||
uint::to_str(i * i, 2u)));
|
||||
i += 1u;
|
||||
@ -176,8 +176,7 @@ fn test_removal() {
|
||||
let i: uint = 0u;
|
||||
while i < num_to_insert {
|
||||
assert (hm.insert(i, i * i));
|
||||
log "inserting " + uint::to_str(i, 10u) + " -> " +
|
||||
uint::to_str(i * i, 10u);
|
||||
#debug("inserting %u -> %u", i, i*i);
|
||||
i += 1u;
|
||||
}
|
||||
assert (hm.size() == num_to_insert);
|
||||
@ -196,8 +195,7 @@ fn test_removal() {
|
||||
#debug("-----");
|
||||
i = 1u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm.get(i));
|
||||
assert (hm.get(i) == i * i);
|
||||
i += 2u;
|
||||
}
|
||||
@ -207,8 +205,7 @@ fn test_removal() {
|
||||
#debug("-----");
|
||||
i = 1u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm.get(i));
|
||||
assert (hm.get(i) == i * i);
|
||||
i += 2u;
|
||||
}
|
||||
@ -216,16 +213,14 @@ fn test_removal() {
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
assert (hm.insert(i, i * i));
|
||||
log "inserting " + uint::to_str(i, 10u) + " -> " +
|
||||
uint::to_str(i * i, 10u);
|
||||
#debug("inserting %u -> %u", i, i*i);
|
||||
i += 2u;
|
||||
}
|
||||
assert (hm.size() == num_to_insert);
|
||||
#debug("-----");
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm.get(i));
|
||||
assert (hm.get(i) == i * i);
|
||||
i += 1u;
|
||||
}
|
||||
@ -236,8 +231,7 @@ fn test_removal() {
|
||||
assert (hm.size() == num_to_insert);
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
log "get(" + uint::to_str(i, 10u) + ") = " +
|
||||
uint::to_str(hm.get(i), 10u);
|
||||
#debug("get(%u) = %u", i, hm.get(i));
|
||||
assert (hm.get(i) == i * i);
|
||||
i += 1u;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ fn test_pipes() {
|
||||
assert (expected == actual);
|
||||
|
||||
fn writeclose(fd: fd_t, s: str) {
|
||||
log_err("writeclose", (fd, s));
|
||||
#error("writeclose %d, %s", fd as int, s);
|
||||
let writer = io::new_writer(io::fd_buf_writer(fd, option::none));
|
||||
writer.write_str(s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user