Register new snapshots, purge log_err and log_full in favour of log(...).

This commit is contained in:
Graydon Hoare 2011-12-22 17:53:53 -08:00
parent ccb5b6fb25
commit f0dfbe7b1b
243 changed files with 705 additions and 702 deletions

View File

@ -269,11 +269,11 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
ref: ref,
tags: tags
});
log_full(core::debug, " Loaded package: " + src.name + "/" + name);
log(debug, " Loaded package: " + src.name + "/" + name);
}
fn load_source_packages(&c: cargo, &src: source) {
log_full(core::debug, "Loading source: " + src.name);
log(debug, "Loading source: " + src.name);
let dir = fs::connect(c.sourcedir, src.name);
let pkgfile = fs::connect(dir, "packages.json");
if !fs::path_exists(pkgfile) { ret; }

View File

@ -596,7 +596,7 @@ fn link_binary(sess: session::session,
fs::connect(fs::dirname(out_filename), long_libname)
} else { out_filename };
log_full(core::debug, "output: " + output);
log(debug, "output: " + output);
// The default library location, we need this to find the runtime.
// The location of crates will be determined as needed.

View File

@ -211,7 +211,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
'a' { kind_noncopyable }
c {
#error("unexpected char in encoded type param: ");
log_full(core::error, c);
log(error, c);
fail
}
};

View File

@ -715,8 +715,8 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
let dbg_cx = option::get(cx.dbg_cx);
#debug("~~");
log_full(core::debug, fcx.id);
log_full(core::debug, cx.sess.span_str(fcx.sp));
log(debug, fcx.id);
log(debug, cx.sess.span_str(fcx.sp));
let (ident, ret_ty, id) = alt cx.ast_map.get(fcx.id) {
ast_map::node_item(item) {
@ -746,8 +746,8 @@ fn create_function(fcx: @fn_ctxt) -> @metadata<subprogram_md> {
}
};
log_full(core::debug, ident);
log_full(core::debug, id);
log(debug, ident);
log(debug, id);
let path = str::connect(fcx.lcx.path + [ident], "::");

View File

@ -20,7 +20,7 @@ fn fn_usage_expr(expr: @ast::expr,
alt ctx.tcx.def_map.find(expr.id) {
some(ast::def_fn(_, ast::unsafe_fn.)) |
some(ast::def_native_fn(_, ast::unsafe_fn.)) {
log_full(core::error, ("expr=", expr_to_str(expr)));
log(error, ("expr=", expr_to_str(expr)));
ctx.tcx.sess.span_fatal(
expr.span,
"unsafe functions can only be called");

View File

@ -447,9 +447,9 @@ fn visit_fn_block_with_scope(_e: @env, decl: fn_decl, blk: ast::blk,
span: span, id: node_id,
sc: scopes, v: vt<scopes>) {
let scope = scope_fn_expr(decl, id, []);
log_full(core::debug, ("scope=", scope));
log(debug, ("scope=", scope));
visit::visit_fn_block(decl, blk, span, id, cons(scope, @sc), v);
log_full(core::debug, ("unscope"));
log(debug, ("unscope"));
}
fn visit_block_with_scope(b: ast::blk, sc: scopes, v: vt<scopes>) {

View File

@ -1120,7 +1120,7 @@ fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {
fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
is_obj_body: bool) ->
@tydesc_info {
log_full(core::debug, "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
log(debug, "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
let ccx = cx.ccx;
let llsize;
let llalign;
@ -1156,7 +1156,7 @@ fn declare_tydesc(cx: @local_ctxt, sp: span, t: ty::t, ty_params: [uint],
mutable cmp_glue: none::<ValueRef>,
ty_params: ty_params,
is_obj_body: is_obj_body};
log_full(core::debug, "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
log(debug, "--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t));
ret info;
}

View File

@ -516,7 +516,7 @@ fn add_span_comment(bcx: @block_ctxt, sp: span, text: str) {
let ccx = bcx_ccx(bcx);
if (!ccx.sess.get_opts().no_asm_comments) {
let s = text + " (" + ccx.sess.span_str(sp) + ")";
log_full(core::debug, s);
log(debug, s);
add_comment(bcx, s);
}
}

View File

@ -15,12 +15,12 @@ fn collect_ids_block(b: blk, rs: @mutable [node_id]) { *rs += [b.node.id]; }
fn collect_ids_stmt(s: @stmt, rs: @mutable [node_id]) {
alt s.node {
stmt_decl(_, id) {
log_full(core::debug, "node_id " + int::str(id));
log(debug, "node_id " + int::str(id));
log_stmt(*s);;
*rs += [id];
}
stmt_expr(_, id) {
log_full(core::debug, "node_id " + int::str(id));
log(debug, "node_id " + int::str(id));
log_stmt(*s);;
*rs += [id];
}
@ -44,7 +44,7 @@ fn node_ids_in_fn(body: blk, rs: @mutable [node_id]) {
fn init_vecs(ccx: crate_ctxt, node_ids: [node_id], len: uint) {
for i: node_id in node_ids {
log_full(core::debug, int::str(i) + " |-> " + uint::str(len));
log(debug, int::str(i) + " |-> " + uint::str(len));
add_node(ccx, i, empty_ann(len));
}
}

View File

@ -78,7 +78,7 @@ fn tritv_to_str(fcx: fn_ctxt, v: tritv::t) -> str {
}
fn log_tritv(fcx: fn_ctxt, v: tritv::t) {
log_full(core::debug, tritv_to_str(fcx, v));
log(debug, tritv_to_str(fcx, v));
}
fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
@ -94,7 +94,7 @@ fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
}
fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) {
log_full(core::error, tritv_to_str(fcx, v));
log(error, tritv_to_str(fcx, v));
}
fn tos(v: [uint]) -> str {
@ -107,9 +107,9 @@ fn tos(v: [uint]) -> str {
ret rslt;
}
fn log_cond(v: [uint]) { log_full(core::debug, tos(v)); }
fn log_cond(v: [uint]) { log(debug, tos(v)); }
fn log_cond_err(v: [uint]) { log_full(core::error, tos(v)); }
fn log_cond_err(v: [uint]) { log(error, tos(v)); }
fn log_pp(pp: pre_and_post) {
let p1 = tritv::to_vec(pp.precondition);
@ -147,11 +147,11 @@ fn log_states_err(pp: pre_and_post_state) {
log_cond_err(p2);
}
fn print_ident(i: ident) { log_full(core::debug, " " + i + " "); }
fn print_ident(i: ident) { log(debug, " " + i + " "); }
fn print_idents(&idents: [ident]) {
if vec::len::<ident>(idents) == 0u { ret; }
log_full(core::debug, "an ident: " + vec::pop::<ident>(idents));
log(debug, "an ident: " + vec::pop::<ident>(idents));
print_idents(idents);
}
@ -550,7 +550,7 @@ fn match_args(fcx: fn_ctxt, occs: @mutable [pred_args],
#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,
log(debug,
"match_args: candidate " + pred_args_to_str(pd));
fn eq(p: inst, q: inst) -> bool { ret p.node == q.node; }
if ty::args_eq(eq, pd.node.args, occ) { ret pd.node.bit_num; }
@ -765,7 +765,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
for (constr_arg_general_<tup(ident, def_id)> p in rslt) {
alt (p) {
case (carg_ident(?p)) {
log_full(core::error, p._0);
log(error, p._0);
}
case (_) {}
}
@ -980,7 +980,7 @@ fn args_mention<T>(args: [@constr_arg_use], q: fn([T], node_id) -> bool,
alt (a.node) {
case (carg_ident(?p1)) {
auto res = q(s, p1._1);
log_full(core::error, (res));
log(error, (res));
res
}
case (_) { false }

View File

@ -72,7 +72,7 @@ fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
#debug("check_states_stmt:");
log_full(core::debug, print::pprust::stmt_to_str(*s));
log(debug, print::pprust::stmt_to_str(*s));
#debug("prec = ");
log_tritv(fcx, prec);
#debug("pres = ");

View File

@ -13,7 +13,7 @@ type ctxt = {cs: @mutable [sp_constr], tcx: ty::ctxt};
fn collect_local(loc: @local, cx: ctxt, v: visit::vt<ctxt>) {
pat_bindings(loc.node.pat) {|p|
let ident = alt p.node { pat_bind(id, _) { id } };
log_full(core::debug, "collect_local: pushing " + ident);;
log(debug, "collect_local: pushing " + ident);;
*cx.cs += [respan(loc.span, ninit(p.id, ident))];
};
visit::visit_local(loc, cx, v);
@ -65,7 +65,7 @@ fn find_locals(tcx: ty::ctxt,
fn add_constraint(tcx: ty::ctxt, c: sp_constr, next: uint, tbl: constr_map) ->
uint {
log_full(core::debug,
log(debug,
constraint_to_str(tcx, c) + " |-> " + uint::str(next));
alt c.node {
ninit(id, i) { tbl.insert(local_def(id), cinit(next, c.span, i)); }

View File

@ -276,7 +276,7 @@ fn handle_var(fcx: fn_ctxt, rslt: pre_and_post, id: node_id, name: ident) {
}
fn handle_var_def(fcx: fn_ctxt, rslt: pre_and_post, def: def, name: ident) {
log_full(core::debug, ("handle_var_def: ", def, name));
log(debug, ("handle_var_def: ", def, name));
alt def {
def_local(d_id, _) | def_arg(d_id, _) {
use_var(fcx, d_id.node);
@ -302,7 +302,7 @@ fn find_pre_post_expr_fn_upvars(fcx: fn_ctxt, e: @expr) {
let rslt = expr_pp(fcx.ccx, e);
clear_pp(rslt);
for def in *freevars::get_freevars(fcx.ccx.tcx, e.id) {
log_full(core::debug, ("handle_var_def: def=", def));
log(debug, ("handle_var_def: def=", def));
handle_var_def(fcx, rslt, def.def, "upvar");
}
}
@ -358,7 +358,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
vec::iter(cap_clause.moves, use_cap_item);
vec::iter(cap_clause.moves) { |cap_item|
log_full(core::debug, ("forget_in_postcond: ", cap_item));
log(debug, ("forget_in_postcond: ", cap_item));
forget_in_postcond(fcx, e.id, cap_item.id);
}
}

View File

@ -621,7 +621,7 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
let stmt_ann = stmt_to_ann(fcx.ccx, *s);
/*
log_full(core::error, ("[" + fcx.name + "]"));
log(error, ("[" + fcx.name + "]"));
#error("*At beginning: stmt = ");
log_stmt_err(*s);
#error("*prestate = ");
@ -653,7 +653,7 @@ fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
#error("poststate =");
log_tritv_err(fcx, stmt_ann.states.poststate);
#error("changed =");
log_full(core::error, changed);
log(error, changed);
*/
ret changed;
@ -727,7 +727,7 @@ fn find_pre_post_state_block(fcx: fn_ctxt, pres0: prestate, b: blk) -> bool {
#error("post:");
log_tritv_err(fcx, post);
#error("changed = ");
log_full(core::error, changed);
log(error, changed);
*/
ret changed;
@ -774,7 +774,7 @@ fn find_pre_post_state_fn(fcx: fn_ctxt,
/*
#error("find_pre_post_state_fn");
log_full(core::error, changed);
log(error, changed);
fcx.ccx.tcx.sess.span_note(f_body.span, fcx.name);
*/

View File

@ -29,7 +29,7 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: @ast::expr,
"first argument to #fmt must be a " + "string literal.");
let fmtspan = args[0].span;
#debug("Format string:");
log_full(core::debug, fmt);
log(debug, fmt);
fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: str) -> ! {
cx.span_fatal(sp, msg);
}
@ -252,7 +252,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
}
fn log_conv(c: conv) {
alt c.param {
some(p) { log_full(core::debug, "param: " + int::to_str(p, 10u)); }
some(p) { log(debug, "param: " + int::to_str(p, 10u)); }
_ { #debug("param: none"); }
}
for f: flag in c.flags {
@ -265,20 +265,20 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
}
}
alt c.width {
count_is(i) { log_full(core::debug,
count_is(i) { log(debug,
"width: count is " + int::to_str(i, 10u)); }
count_is_param(i) {
log_full(core::debug,
log(debug,
"width: count is param " + int::to_str(i, 10u));
}
count_is_next_param. { #debug("width: count is next param"); }
count_implied. { #debug("width: count is implied"); }
}
alt c.precision {
count_is(i) { log_full(core::debug,
count_is(i) { log(debug,
"prec: count is " + int::to_str(i, 10u)); }
count_is_param(i) {
log_full(core::debug,
log(debug,
"prec: count is param " + int::to_str(i, 10u));
}
count_is_next_param. { #debug("prec: count is next param"); }

View File

@ -580,7 +580,7 @@ fn read_line_comments(rdr: reader, code_to_the_left: bool) -> cmnt {
let lines: [str] = [];
while rdr.curr() == '/' && rdr.next() == '/' {
let line = read_one_line_comment(rdr);
log_full(core::debug, line);
log(debug, line);
lines += [line];
consume_non_eol_whitespace(rdr);
}
@ -603,7 +603,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) {
s1 = str::slice(s, col, str::byte_len(s));
} else { s1 = ""; }
} else { s1 = s; }
log_full(core::debug, "pushing line: " + s1);
log(debug, "pushing line: " + s1);
lines += [s1];
}
@ -707,7 +707,7 @@ fn gather_comments_and_literals(cm: codemap::codemap, path: str,
if is_lit(tok.tok) {
literals += [{lit: rdr.get_str_from(tok.bpos), pos: tok.chpos}];
}
log_full(core::debug, "tok: " + token::to_str(rdr, tok.tok));
log(debug, "tok: " + token::to_str(rdr, tok.tok));
first_read = false;
}
ret {cmnts: comments, lits: literals};

View File

@ -165,8 +165,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
"cont", "ret", "be", "fail", "type", "resource", "check",
"assert", "claim", "native", "fn", "lambda", "pure",
"unsafe", "block", "import", "export", "let", "const",
"log", "log_err", "log_full",
"tag", "obj", "copy", "sendfn", "impl"] {
"log", "tag", "obj", "copy", "sendfn", "impl"] {
words.insert(word, ());
}
words
@ -910,10 +909,7 @@ 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")
|| eat_word(p, "log")
|| eat_word(p, "log_err")) {
} else if eat_word(p, "log") {
expect(p, token::LPAREN);
let lvl = parse_expr(p);
expect(p, token::COMMA);

View File

@ -413,7 +413,7 @@ obj printer(out: io::writer,
fn print(x: token, L: int) {
#debug("print %s %d (remaining line space=%d)", tok_str(x), L,
space);
log_full(core::debug, buf_str(token, size, left, right, 6u));
log(debug, buf_str(token, size, left, right, 6u));
alt x {
BEGIN(b) {
if L > space {

View File

@ -916,7 +916,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
1 { word_nbsp(s, "log"); print_expr(s, expr); }
0 { word_nbsp(s, "log_err"); print_expr(s, expr); }
2 {
word_nbsp(s, "log_full");
word_nbsp(s, "log");
popen(s);
print_expr(s, lexp);
word(s.s, ",");

View File

@ -36,38 +36,38 @@ fn field_exprs(fields: [ast::field]) -> [@ast::expr] {
}
fn log_expr(e: ast::expr) {
log_full(core::debug, print::pprust::expr_to_str(@e));
log(debug, print::pprust::expr_to_str(@e));
}
fn log_expr_err(e: ast::expr) {
log_full(core::error, print::pprust::expr_to_str(@e));
log(error, print::pprust::expr_to_str(@e));
}
fn log_ty_err(t: @ty) {
log_full(core::error, print::pprust::ty_to_str(t));
log(error, print::pprust::ty_to_str(t));
}
fn log_pat_err(p: @pat) {
log_full(core::error, print::pprust::pat_to_str(p));
log(error, print::pprust::pat_to_str(p));
}
fn log_block(b: ast::blk) {
log_full(core::debug, print::pprust::block_to_str(b));
log(debug, print::pprust::block_to_str(b));
}
fn log_block_err(b: ast::blk) {
log_full(core::error, print::pprust::block_to_str(b));
log(error, print::pprust::block_to_str(b));
}
fn log_item_err(i: @ast::item) {
log_full(core::error, print::pprust::item_to_str(i));
log(error, print::pprust::item_to_str(i));
}
fn log_stmt(st: ast::stmt) {
log_full(core::debug, print::pprust::stmt_to_str(st));
log(debug, print::pprust::stmt_to_str(st));
}
fn log_stmt_err(st: ast::stmt) {
log_full(core::error, print::pprust::stmt_to_str(st));
log(error, print::pprust::stmt_to_str(st));
}
fn has_nonlocal_exits(b: ast::blk) -> bool {

View File

@ -33,6 +33,6 @@ fn path_div() -> str { ":" }
fn path_div() -> str { ";" }
fn logv(config: config, s: str) {
log_full(core::debug, s);
log(debug, s);
if config.verbose { io::stdout().write_line(s); }
}

View File

@ -242,9 +242,9 @@ fn check_variants_T<copy T>(
if L < 100u {
under(float::min(L, 20u)) {|i|
log_full(core::error, "Replacing... #" + uint::str(i));
log(error, "Replacing... #" + uint::str(i));
under(float::min(L, 30u)) {|j|
log_full(core::error, "With... " + stringifier(@things[j]));
log(error, "With... " + stringifier(@things[j]));
let crate2 = @replacer(crate, i, things[j], cx.mode);
// It would be best to test the *crate* for stability, but testing the
// string for stability is easier and ok for now.
@ -298,8 +298,8 @@ fn check_whole_compiler(code: str, suggested_filename_prefix: str, allow_running
removeDirIfExists(suggested_filename_prefix + ".dSYM");
}
failed(s) {
log_full(core::error, "check_whole_compiler failure: " + s);
log_full(core::error, "Saved as: " + filename);
log(error, "check_whole_compiler failure: " + s);
log(error, "Saved as: " + filename);
}
}
}
@ -320,7 +320,7 @@ fn check_running(exe_filename: str) -> happiness {
let p = std::run::program_output("/Users/jruderman/scripts/timed_run_rust_program.py", [exe_filename]);
let comb = p.out + "\n" + p.err;
if str::byte_len(comb) > 1u {
log_full(core::error, "comb comb comb: " + comb);
log(error, "comb comb comb: " + comb);
}
if contains(comb, "Assertion failed: (0), function alloc, file ../src/rt/rust_obstack.cpp") {
@ -369,7 +369,7 @@ fn check_compiling(filename: str) -> happiness {
} else if contains(p.err, "cast<Ty>() argument of incompatible type!") {
known_bug("https://github.com/graydon/rust/issues/973")
} else {
log_full(core::error, "Stderr: " + p.err);
log(error, "Stderr: " + p.err);
failed("Unfamiliar error message")
}
} else if p.status == 0 {
@ -382,7 +382,7 @@ fn check_compiling(filename: str) -> happiness {
} else if contains(p.out, "trans_rec expected a rec but found _|_") {
known_bug("https://github.com/graydon/rust/issues/924")
} else if contains(p.out, "Assertion") && contains(p.out, "failed") {
log_full(core::error, "Stdout: " + p.out);
log(error, "Stdout: " + p.out);
failed("Looks like an llvm assertion failure")
} else if contains(p.out, "internal compiler error fail called with unsupported type _|_") {
@ -396,14 +396,14 @@ fn check_compiling(filename: str) -> happiness {
} else if contains(p.out, "internal compiler error unimplemented") {
known_bug("Something unimplemented")
} else if contains(p.out, "internal compiler error") {
log_full(core::error, "Stdout: " + p.out);
log(error, "Stdout: " + p.out);
failed("internal compiler error")
} else if contains(p.out, "error:") {
cleanly_rejected("rejected with span_error")
} else {
log_full(core::error, p.status);
log_full(core::error, "!Stdout: " + p.out);
log(error, p.status);
log(error, "!Stdout: " + p.out);
failed("What happened?")
}
}
@ -543,7 +543,7 @@ fn check_variants(files: [str], cx: context) {
cont;
}
log_full(core::error, "check_variants: " + file);
log(error, "check_variants: " + file);
let sess = @{cm: codemap::new_codemap(), mutable next_id: 0};
let crate =
parser::parse_crate_from_source_str(

View File

@ -91,9 +91,9 @@ fn vec_to_str(v: [int]) -> str {
}
fn show_edits(a: [int], xs: [int]) {
log_full(core::error, "=== Edits of " + vec_to_str(a) + " ===");
log(error, "=== Edits of " + vec_to_str(a) + " ===");
let b = vec_edits(a, xs);
ix(0u, 1u, len(b)) {|i| log_full(core::error, vec_to_str(b[i])); }
ix(0u, 1u, len(b)) {|i| log(error, vec_to_str(b[i])); }
}
fn demo_edits() {

View File

@ -69,13 +69,13 @@ fn main()
{
let r = rand::mk_rng();
log_full(core::error, under(r, 5u));
log_full(core::error, choice(r, [10, 20, 30]));
log_full(core::error, if unlikely(r, 5u) { "unlikely" } else { "likely" });
log(error, under(r, 5u));
log(error, choice(r, [10, 20, 30]));
log(error, if unlikely(r, 5u) { "unlikely" } else { "likely" });
let a = [mutable 1, 2, 3];
shuffle(r, a);
log_full(core::error, a);
log(error, a);
let i = 0u;
let v = [
@ -86,8 +86,8 @@ fn main()
let w = weighted_vec(v);
while i < 1000u {
log_full(core::error, "Immed: " + weighted_choice(r, v));
log_full(core::error, "Fast: " + choice(r, w));
log(error, "Immed: " + weighted_choice(r, v));
log(error, "Fast: " + choice(r, w));
i += 1u;
}
}

View File

@ -287,7 +287,7 @@ Example:
> let i = 0;
> while i < len(s) {
> let {ch, next} = char_range_at(s, i);
> log_full(core::debug, ch);
> log(debug, ch);
> i = next;
> }

View File

@ -22,7 +22,7 @@ Tasks may execute in parallel and are scheduled automatically by the runtime.
Example:
> spawn("Hello, World", fn (&&msg: str) {
> log_full(core::debug, msg);
> log(debug, msg);
> });
*/

View File

@ -292,7 +292,7 @@ obj fd_buf_writer(fd: fd_t, res: option::t<@fd_res>) {
let nout = os::libc::write(fd, vbuf, len);
if nout < 0 {
#error("error dumping buffer");
log_full(core::error, sys::last_os_error());
log(error, sys::last_os_error());
fail;
}
count += nout as uint;
@ -334,7 +334,7 @@ fn file_buf_writer(path: str,
os::libc_constants::S_IWUSR)
});
ret if fd < 0i32 {
log_full(core::error, sys::last_os_error());
log(error, sys::last_os_error());
result::err("error opening " + path)
} else {
result::ok(fd_buf_writer(fd, option::some(@fd_res(fd))))

View File

@ -1,3 +1,10 @@
S 2011-12-22 ccb5b6f
winnt-i386 35be60caa888246e9710bd34ccbbe8a322d3c6de
linux-i386 8f88a285fa86613e268503a310e32cb053c2e300
macos-i386 c4cdd0a41fedb6d58d2a503ee3000c51d7878679
linux-x86_64 9c78b05bf4fba7d42e1d41c92790d018f98336ef
macos-x86_64 40d3bce53fefcd07e4f35b926e89fac2213792c1
S 2011-12-22 3b61064
winnt-i386 800fdc0e15f6917ff4318812edac611ca0162b5e
linux-i386 468d13787022414aeb7f8ca755a4559691728a49

View File

@ -47,10 +47,10 @@ fn ninetynine(it: block(int)) {
fn main() {
ninetynine {|n|
log_full(core::debug, sub(b1(), n));
log_full(core::debug, sub(b2(), n - 1));
log(debug, sub(b1(), n));
log(debug, sub(b2(), n - 1));
#debug("");
};
log_full(core::debug, b7());
log_full(core::debug, b8());
log(debug, b7());
log(debug, b8());
}

View File

@ -43,10 +43,10 @@ fn sub(t: str, n: int) -> str {
fn main() {
let n: int = 99;
while n > 0 {
log_full(core::debug, sub(b1(), n));
log_full(core::debug, sub(b2(), n - 1));
log(debug, sub(b1(), n));
log(debug, sub(b2(), n - 1));
#debug(""); n -= 1;
}
log_full(core::debug, b7());
log_full(core::debug, sub(b8(), 99));
log(debug, b7());
log(debug, sub(b8(), 99));
}

View File

@ -43,7 +43,7 @@ fn fannkuch(n: int) -> int {
let go = true;
while go {
if r == n { log_full(core::debug, checksum); ret flips; }
if r == n { log(debug, checksum); ret flips; }
let p0 = perm1[0];
i = 0;
while i < r { let j = i + 1; perm1[i] = perm1[j]; i = j; }

View File

@ -44,31 +44,31 @@ fn select_random(r: u32, genelist: [aminoacids]) -> char {
}
fn make_random_fasta(id: str, desc: str, genelist: [aminoacids], n: int) {
log_full(core::debug, ">" + id + " " + desc);
log(debug, ">" + id + " " + desc);
let rng = myrandom(std::rand::mk_rng().next());
let op: str = "";
uint::range(0u, n as uint) {|i|
str::push_byte(op, select_random(rng.next(100u32), genelist) as u8);
if str::byte_len(op) >= LINE_LENGTH() {
log_full(core::debug, op);
log(debug, op);
op = "";
}
}
if str::byte_len(op) > 0u { log_full(core::debug, op); }
if str::byte_len(op) > 0u { log(debug, op); }
}
fn make_repeat_fasta(id: str, desc: str, s: str, n: int) {
log_full(core::debug, ">" + id + " " + desc);
log(debug, ">" + id + " " + desc);
let op: str = "";
let sl: uint = str::byte_len(s);
uint::range(0u, n as uint) {|i|
str::push_byte(op, s[i % sl]);
if str::byte_len(op) >= LINE_LENGTH() {
log_full(core::debug, op);
log(debug, op);
op = "";
}
}
if str::byte_len(op) > 0u { log_full(core::debug, op); }
if str::byte_len(op) > 0u { log(debug, op); }
}
fn acid(ch: char, prob: u32) -> aminoacids { ret {ch: ch, prob: prob}; }

View File

@ -14,6 +14,6 @@ fn fib(n: int) -> int {
fn main() {
assert (fib(8) == 21);
assert (fib(15) == 610);
log_full(core::debug, fib(8));
log_full(core::debug, fib(15));
log(debug, fib(8));
log(debug, fib(15));
}

View File

@ -20,11 +20,11 @@ fn main() {
for n: int in inputs {
log_full(core::debug, NBodySystem::energy(bodies));
log(debug, NBodySystem::energy(bodies));
let i: int = 0;
while i < n { NBodySystem::advance(bodies, 0.01); i += 1; }
log_full(core::debug, NBodySystem::energy(bodies));
log(debug, NBodySystem::energy(bodies));
}
}

View File

@ -87,7 +87,7 @@ fn stress(num_tasks: int) {
fn main(argv: [str]) {
if vec::len(argv) == 1u {
assert (fib(8) == 21);
log_full(core::debug, fib(8));
log(debug, fib(8));
} else {
// Interactive mode! Wooo!!!!
let opts = parse_opts(argv);

View File

@ -88,7 +88,7 @@ mod map_reduce {
send V>(-map: mapper<K1, K2, V>,
-ctrl: chan<ctrl_proto<K2, V>>,
-input: K1) {
// log_full(core::error, "map_task " + input);
// log(error, "map_task " + input);
let intermediates = treemap::init();
fn emit<send K2,
@ -172,15 +172,15 @@ mod map_reduce {
}
find_reducer(k, cc) {
let c;
// log_full(core::error, "finding reducer for " + k);
// log(error, "finding reducer for " + k);
alt treemap::find(reducers, k) {
some(_c) {
// log_full(core::error,
// log(error,
// "reusing existing reducer for " + k);
c = _c;
}
none. {
// log_full(core::error, "creating new reducer for " + k);
// log(error, "creating new reducer for " + k);
let p = port();
let r = reduce, kk = k;
tasks +=
@ -229,7 +229,7 @@ fn main(argv: [str]) {
let elapsed = stop - start;
elapsed /= 1000000u64;
log_full(core::error, "MapReduce completed in "
log(error, "MapReduce completed in "
+ u64::str(elapsed) + "ms");
}

View File

@ -78,7 +78,7 @@ mod map_reduce {
fn map_task(args: (chan<ctrl_proto>, str)) {
let (ctrl, input) = args;
// log_full(core::error, "map_task " + input);
// log(error, "map_task " + input);
let intermediates = map::new_str_hash();
fn emit(im: map::hashmap<str, chan<reduce_proto>>,
@ -158,15 +158,15 @@ mod map_reduce {
}
find_reducer(k, cc) {
let c;
// log_full(core::error, "finding reducer for " + k);
// log(error, "finding reducer for " + k);
alt reducers.find(k) {
some(_c) {
// log_full(core::error,
// log(error,
// "reusing existing reducer for " + k);
c = _c;
}
none. {
// log_full(core::error, "creating new reducer for " + k);
// log(error, "creating new reducer for " + k);
let p = port();
tasks +=
[task::spawn_joinable((k, chan(p)), reduce_task)];
@ -201,7 +201,7 @@ fn main(argv: [str]) {
let elapsed = stop - start;
elapsed /= 1000000u64;
log_full(core::error, "MapReduce completed in "
log(error, "MapReduce completed in "
+ u64::str(elapsed) + "ms");
}

View File

@ -7,6 +7,6 @@ fn my_fail() -> ! { fail; }
fn main() {
alt true { false { my_fail(); } true { } }
log_full(core::debug, x);
log(debug, x);
let x: int;
}

View File

@ -3,6 +3,6 @@
fn main() {
let i: int;
log_full(core::debug, false && { i = 5; true });
log_full(core::debug, i);
log(debug, false && { i = 5; true });
log(debug, i);
}

View File

@ -18,5 +18,5 @@ fn main() {
my_a
};
log_full(core::error, my_b.foo());
log(error, my_b.foo());
}

View File

@ -7,11 +7,11 @@ fn main() {
let a: clam = {x: @1, y: @2};
let b: clam = {x: @10, y: @20};
let z: int = a.x + b.y;
log_full(core::debug, z);
log(debug, z);
assert (z == 21);
let forty: fish = {a: @40};
let two: fish = {a: @2};
let answer: int = forty.a + two.a;
log_full(core::debug, answer);
log(debug, answer);
assert (answer == 42);
}

View File

@ -2,6 +2,6 @@
// Tests that a function with a ! annotation always actually fails
// error-pattern: some control paths may return
fn bad_bang(i: uint) -> ! { log_full(core::debug, 3); }
fn bad_bang(i: uint) -> ! { log(debug, 3); }
fn main() { bad_bang(5u); }

View File

@ -1,4 +1,4 @@
// error-pattern:expected str but found int
const i: str = 10;
fn main() { log_full(core::debug, i); }
fn main() { log(debug, i); }

View File

@ -1,6 +1,6 @@
// error-pattern: attempted dynamic environment-capture
fn foo() {
let x: int;
fn bar() { log_full(core::debug, x); }
fn bar() { log(debug, x); }
}
fn main() { foo(); }

View File

@ -1,5 +1,5 @@
// error-pattern: attempted dynamic environment-capture
fn foo(x: int) {
fn bar() { log_full(core::debug, x); }
fn bar() { log(debug, x); }
}
fn main() { foo(2); }

View File

@ -1,7 +1,7 @@
// error-pattern: attempted dynamic environment-capture
obj foo(x: int) {
fn mth() {
fn bar() { log_full(core::debug, x); }
fn bar() { log(debug, x); }
}
}

View File

@ -2,4 +2,4 @@
mod m1 { }
fn main(args: [str]) { log_full(core::debug, m1::a); }
fn main(args: [str]) { log(debug, m1::a); }

View File

@ -4,4 +4,4 @@ mod m1 {
mod a { }
}
fn main(args: [str]) { log_full(core::debug, m1::a); }
fn main(args: [str]) { log(debug, m1::a); }

View File

@ -12,5 +12,5 @@ fn coerce(b: block()) -> fn() {
fn main() {
let i = 8;
let f = coerce(block () { log_full(core::error, i); });
let f = coerce(block () { log(error, i); });
f(); }

View File

@ -3,6 +3,6 @@
fn lol(f: block()) -> block() { ret f; }
fn main() {
let i = 8;
let f = lol(block () { log_full(core::error, i); });
let f = lol(block () { log(error, i); });
f();
}

View File

@ -1,3 +1,3 @@
// error-pattern: not all control paths return
fn force(f: block() -> int) -> int { f() }
fn main() { log_full(core::error, force({|| })); }
fn main() { log(error, force({|| })); }

View File

@ -1,4 +1,4 @@
// error-pattern: Unsatisfied precondition constraint
fn force(f: block()) { f(); }
fn main() { let x: int; force(block () { log_full(core::error, x); }); }
fn main() { let x: int; force(block () { log(error, x); }); }

View File

@ -6,9 +6,9 @@ fn foo() -> int {
do { i = 0; break; x = 0; } while x != 0
log_full(core::debug, x);
log(debug, x);
ret 17;
}
fn main() { log_full(core::debug, foo()); }
fn main() { log(debug, foo()); }

View File

@ -6,9 +6,9 @@ fn foo() -> int {
do { i = 0; break; x = 0; } while 1 != 2
log_full(core::debug, x);
log(debug, x);
ret 17;
}
fn main() { log_full(core::debug, foo()); }
fn main() { log(debug, foo()); }

View File

@ -12,5 +12,5 @@ fn main() {
let a: int = 1;
let b: int = 2;
let c: ordered_range = {low: a, high: b};
log_full(core::debug, c.low);
log(debug, c.low);
}

View File

@ -2,4 +2,4 @@
resource foo(i: int) { }
fn main() { let x <- foo(10); let y = x; log_full(core::error, x); }
fn main() { let x <- foo(10); let y = x; log(error, x); }

View File

@ -3,7 +3,7 @@
// error-pattern: dead
fn f(caller: str) { log_full(core::debug, caller); }
fn f(caller: str) { log(debug, caller); }
fn main() { be f("main"); #debug("Paul is dead"); }

View File

@ -3,7 +3,7 @@
// error-pattern: dead
fn f(caller: str) { log_full(core::debug, caller); }
fn f(caller: str) { log(debug, caller); }
fn main() { ret f("main"); #debug("Paul is dead"); }

View File

@ -4,7 +4,7 @@ fn main() {
let y: int = 42;
let x: int;
do {
log_full(core::debug, y);
log(debug, y);
do { do { do { x <- y; } while true } while true } while true
} while true
}

View File

@ -1,6 +1,6 @@
// error-pattern: Unsatisfied precondition constraint (for example, even(y
fn print_even(y: int) : even(y) { log_full(core::debug, y); }
fn print_even(y: int) : even(y) { log(debug, y); }
pure fn even(y: int) -> bool { true }

View File

@ -1,8 +1,8 @@
// error-pattern: unresolved name
mod foo {
export x;
fn x(y: int) { log_full(core::debug, y); }
fn z(y: int) { log_full(core::debug, y); }
fn x(y: int) { log(debug, y); }
fn z(y: int) { log(debug, y); }
}
fn main() { foo::z(10); }

View File

@ -5,5 +5,5 @@ import str::*;
fn main() {
let a: uint = 4u;
let b: uint = 1u;
log_full(core::error, safe_slice("kitties", a, b));
log(error, safe_slice("kitties", a, b));
}

View File

@ -3,5 +3,5 @@
fn main() {
// Typestate should work even in a lambda. we should reject this program.
let f = fn () -> int { let i: int; ret i; };
log_full(core::error, f());
log(error, f());
}

View File

@ -2,5 +2,5 @@
fn main() {
let j = fn () -> int { let i: int; ret i; }();
log_full(core::error, j);
log(error, j);
}

View File

@ -5,7 +5,7 @@ pure fn even(x: uint) -> bool {
} else if x == 2u { ret true; } else { ret even(x - 2u); }
}
fn print_even(x: uint) : even(x) { log_full(core::debug, x); }
fn print_even(x: uint) : even(x) { log(debug, x); }
fn foo(x: uint) { if check even(x) { fail; } else { print_even(x); } }

View File

@ -2,5 +2,5 @@
fn main() {
let a = if true { true };
log_full(core::debug, a);
log(debug, a);
}

View File

@ -6,10 +6,10 @@ fn f2(x: block()) { x(); }
fn main() {
let i = 0;
let ctr = lambda () -> int { f2({|| i = i + 1; }); ret i; };
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, i);
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, i);
}

View File

@ -3,10 +3,10 @@
fn main() {
let i = 0;
let ctr = lambda () -> int { i = i + 1; ret i; };
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, ctr());
log_full(core::error, i);
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, ctr());
log(error, i);
}

View File

@ -1,4 +1,4 @@
// error-pattern: Unsatisfied precondition constraint
fn test(-foo: int) { assert (foo == 10); }
fn main() { let x = 10; test(x); log_full(core::debug, x); }
fn main() { let x = 10; test(x); log(debug, x); }

View File

@ -16,5 +16,5 @@ fn main() {
// the next statement, since it's not true in the
// prestate.
let d <- a;
log_full(core::debug, safe_slice("kitties", b, d));
log(debug, safe_slice("kitties", b, d));
}

View File

@ -4,5 +4,5 @@ use std;
import std::os;
fn main() {
log_full(core::debug, { x: 1 } as int);
log(debug, { x: 1 } as int);
}

View File

@ -10,4 +10,4 @@ fn enum_chars(start: u8, end: u8) : uint::le(start, end) -> [char] {
ret r;
}
fn main() { log_full(core::debug, enum_chars('a' as u8, 'z' as u8)); }
fn main() { log(debug, enum_chars('a' as u8, 'z' as u8)); }

View File

@ -3,6 +3,6 @@
fn main() {
let i: int;
log_full(core::debug, false || { i = 5; true });
log_full(core::debug, i);
log(debug, false || { i = 5; true });
log(debug, i);
}

View File

@ -1,3 +1,3 @@
// error-pattern:literal out of range
fn main() { log_full(core::debug, 300u8); }
fn main() { log(debug, 300u8); }

View File

@ -10,7 +10,7 @@ tag bar { t1((), option::t<[int]>); t2; }
fn foo(t: bar) {
alt t {
t1(_, some::<int>(x)) {
log_full(core::debug, x);
log(debug, x);
}
_ { fail; }
}

View File

@ -10,7 +10,7 @@ fn main() {
// Can't do this copy
let x = ~~~{y: r(i)};
let z = x;
log_full(core::debug, x);
log(debug, x);
}
log_full(core::error, *i);
log(error, *i);
}

View File

@ -6,4 +6,4 @@
type point = {x: int, y: int};
fn main() { let p: point = {x: 10}; log_full(core::debug, p.y); }
fn main() { let p: point = {x: 10}; log(debug, p.y); }

View File

@ -1,13 +1,13 @@
// error-pattern: copying a noncopyable value
resource my_resource(x: int) {
log_full(core::error, x);
log(error, x);
}
fn main() {
{
let a = {x: 0, y: my_resource(20)};
let b = {x: 2 with a};
log_full(core::error, (a, b));
log(error, (a, b));
}
}

View File

@ -4,7 +4,7 @@ fn main() {
let x = [];
let &y = x;
while true {
log_full(core::error, y);
log(error, y);
x = [1];
}
}

View File

@ -6,5 +6,5 @@ fn test(f: lambda(uint) -> uint) -> uint {
fn main() {
let f = sendfn(x: uint) -> uint { ret 4u; };
log_full(core::debug, test(f));
log(debug, test(f));
}

View File

@ -6,5 +6,5 @@ resource r(b: bool) {
fn main() {
let i <- ~r(true);
let j = i;
log_full(core::debug, i);
log(debug, i);
}

View File

@ -14,6 +14,6 @@ fn main() {
let r1 <- [~r(i1)];
let r2 <- [~r(i2)];
f(r1, r2);
log_full(core::debug, (r2, *i1));
log_full(core::debug, (r1, *i2));
log(debug, (r2, *i1));
log(debug, (r1, *i2));
}

View File

@ -4,5 +4,5 @@ fn whoknows(x: @mutable {mutable x: int}) { x.x = 10; }
fn main() {
let box = @mutable {mutable x: 1};
alt *box { x { whoknows(box); log_full(core::error, x); } }
alt *box { x { whoknows(box); log(error, x); } }
}

View File

@ -1,6 +1,6 @@
// error-pattern:may alias with argument
fn foo(x: {mutable x: int}, f: fn@()) { log_full(core::debug, x); }
fn foo(x: {mutable x: int}, f: fn@()) { log(debug, x); }
fn whoknows(x: @mutable {mutable x: int}) { *x = {mutable x: 10}; }

View File

@ -4,5 +4,5 @@ tag foo { left({mutable x: int}); right(bool); }
fn main() {
let x = left({mutable x: 10});
alt x { left(i) { x = right(false); log_full(core::debug, i); } _ { } }
alt x { left(i) { x = right(false); log(debug, i); } _ { } }
}

View File

@ -2,5 +2,5 @@
fn main() {
let v: [mutable {mutable x: int}] = [mutable {mutable x: 1}];
for x in v { v[0] = {mutable x: 2}; log_full(core::debug, x); }
for x in v { v[0] = {mutable x: 2}; log(debug, x); }
}

View File

@ -5,4 +5,4 @@ fn f(a: {mutable x: int}, &b: {mutable x: int}) -> int {
ret a.x + b.x;
}
fn main() { let i = {mutable x: 4}; log_full(core::debug, f(i, i)); }
fn main() { let i = {mutable x: 4}; log(debug, f(i, i)); }

View File

@ -4,5 +4,5 @@ use std;
import std::os;
fn main() {
log_full(core::debug, 1.0 as os::libc::FILE); // Can't cast float to native.
log(debug, 1.0 as os::libc::FILE); // Can't cast float to native.
}

View File

@ -1,2 +1,2 @@
// error-pattern: Unsatisfied precondition constraint (for example, init(x
fn main() { let x = @5; let y <- x; log_full(core::debug, *x); }
fn main() { let x = @5; let y <- x; log(debug, *x); }

View File

@ -1,16 +1,16 @@
// error-pattern: Unsatisfied precondition constraint
fn send<send T>(ch: _chan<T>, -data: T) {
log_full(core::debug, ch);
log_full(core::debug, data);
log(debug, ch);
log(debug, data);
fail;
}
type _chan<T> = int;
// Tests that "log_full(core::debug, message);" is flagged as using
// Tests that "log(debug, message);" is flagged as using
// message after the send deinitializes it
fn test00_start(ch: _chan<int>, message: int, count: int) {
send(ch, message);
log_full(core::debug, message);
log(debug, message);
}
fn main() { fail; }

View File

@ -1,5 +1,5 @@
// error-pattern:Unsatisfied precondition
fn foo(x: int) { log_full(core::debug, x); }
fn foo(x: int) { log(debug, x); }
fn main() { let x: int; if 1 > 2 { x = 10; } foo(x); }

View File

@ -1,6 +1,6 @@
// error-pattern:Unsatisfied precondition
fn foo(x: int) { log_full(core::debug, x); }
fn foo(x: int) { log(debug, x); }
fn main() {
let x: int;

View File

@ -1,5 +1,5 @@
// error-pattern:Unsatisfied precondition
fn foo(x: int) { log_full(core::debug, x); }
fn foo(x: int) { log(debug, x); }
fn main() { let x: int; foo(x); }

View File

@ -3,7 +3,7 @@
fn f() {
let v = [1];
log_full(core::debug, v.some_field_name); //type error
log(debug, v.some_field_name); //type error
}
fn main() { }

View File

@ -7,5 +7,5 @@ fn main() {
let i <- [r(0)];
let j <- [r(1)];
let k = i + j;
log_full(core::debug, j);
log(debug, j);
}

View File

@ -4,7 +4,7 @@ fn main() {
let y: int = 42;
let x: int;
while true {
log_full(core::debug, y);
log(debug, y);
while true {
while true {
while true { x <- y; }

View File

@ -1,6 +1,6 @@
// error-pattern: Unsatisfied precondition constraint (for example, even(y
fn print_even(y: int) : even(y) { log_full(core::debug, y); }
fn print_even(y: int) : even(y) { log(debug, y); }
pure fn even(y: int) -> bool { true }

View File

@ -1,3 +1,3 @@
// error-pattern:quux
fn my_err(s: str) -> ! { log_full(core::error, s); fail "quux"; }
fn my_err(s: str) -> ! { log(error, s); fail "quux"; }
fn main() { 3u == my_err("bye"); }

View File

@ -1,3 +1,3 @@
// error-pattern:quux
fn my_err(s: str) -> ! { log_full(core::error, s); fail "quux"; }
fn my_err(s: str) -> ! { log(error, s); fail "quux"; }
fn main() { my_err("bye") == 3u; }

View File

@ -1,4 +1,4 @@
// error-pattern:woe
fn f(a: int) { log_full(core::debug, a); }
fn f(a: int) { log(debug, a); }
fn main() { f(fail "woe"); }

Some files were not shown because too many files have changed in this diff Show More